Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1647683002: Add vmov between integers and floats in ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===//
2 // 2 //
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 // 6 //
7 // Modified by the Subzero authors. 7 // Modified by the Subzero authors.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 // 10 //
(...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 // 2420 //
2421 // cccc11101D110000dddd101101M0mmmm where cccc=Cond, Ddddd=Sd, and Mmmmm=Sm. 2421 // cccc11101D110000dddd101101M0mmmm where cccc=Cond, Ddddd=Sd, and Mmmmm=Sm.
2422 constexpr const char *Vmovdd = "Vmovdd"; 2422 constexpr const char *Vmovdd = "Vmovdd";
2423 IValueT Dd = encodeSRegister(OpDd, "Dd", Vmovdd); 2423 IValueT Dd = encodeSRegister(OpDd, "Dd", Vmovdd);
2424 IValueT Dm = encodeSRegister(OpDm, "Dm", Vmovdd); 2424 IValueT Dm = encodeSRegister(OpDm, "Dm", Vmovdd);
2425 constexpr IValueT VmovddOpcode = B23 | B21 | B20 | B6; 2425 constexpr IValueT VmovddOpcode = B23 | B21 | B20 | B6;
2426 constexpr IValueT D0 = 0; 2426 constexpr IValueT D0 = 0;
2427 emitVFPddd(Cond, VmovddOpcode, Dd, D0, Dm); 2427 emitVFPddd(Cond, VmovddOpcode, Dd, D0, Dm);
2428 } 2428 }
2429 2429
2430 void AssemblerARM32::vmovrs(const Operand *OpRt, const Operand *OpSn,
2431 CondARM32::Cond Cond) {
2432 // VMOV (between ARM core register and single-precision register)
2433 // ARM section A8.8.343, encoding A1.
2434 //
2435 // vmov<c> <Rt>, <Sn>
2436 //
2437 // cccc11100001nnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt.
2438 constexpr const char *Vmovrs = "vmovrs";
2439 IValueT Rt = encodeGPRegister(OpRt, "Rt", Vmovrs);
2440 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovrs);
2441 assert(CondARM32::isDefined(Cond));
2442 IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B27 | B26 |
2443 B25 | B20 | B11 | B9 | B4 | (getXXXXInRegXXXXY(Sn) << 16) |
2444 (Rt << kRdShift) | (getYInRegXXXXY(Sn) << 7);
2445 emitInst(Encoding);
2446 }
2447
2430 void AssemblerARM32::vmovs(const Operand *OpSd, 2448 void AssemblerARM32::vmovs(const Operand *OpSd,
2431 const OperandARM32FlexFpImm *OpFpImm, 2449 const OperandARM32FlexFpImm *OpFpImm,
2432 CondARM32::Cond Cond) { 2450 CondARM32::Cond Cond) {
2433 // VMOV (immediate) - ARM section A8.8.339, encoding A2: 2451 // VMOV (immediate) - ARM section A8.8.339, encoding A2:
2434 // vmov<c>.f32 <Sd>, #<imm> 2452 // vmov<c>.f32 <Sd>, #<imm>
2435 // 2453 //
2436 // cccc11101D11xxxxdddd10100000yyyy where cccc=Cond, ddddD=Sn, xxxxyyyy=imm. 2454 // cccc11101D11xxxxdddd10100000yyyy where cccc=Cond, ddddD=Sn, xxxxyyyy=imm.
2437 constexpr const char *Vmovs = "vmovs"; 2455 constexpr const char *Vmovs = "vmovs";
2438 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmovs); 2456 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmovs);
2439 IValueT Imm8 = OpFpImm->getModifiedImm(); 2457 IValueT Imm8 = OpFpImm->getModifiedImm();
(...skipping 18 matching lines...) Expand all
2458 emitVFPsss(Cond, VmovssOpcode, Sd, S0, Sm); 2476 emitVFPsss(Cond, VmovssOpcode, Sd, S0, Sm);
2459 } 2477 }
2460 2478
2461 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt, 2479 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt,
2462 CondARM32::Cond Cond) { 2480 CondARM32::Cond Cond) {
2463 // VMOV (between ARM core register and single-precision register) 2481 // VMOV (between ARM core register and single-precision register)
2464 // ARM section A8.8.343, encoding A1. 2482 // ARM section A8.8.343, encoding A1.
2465 // 2483 //
2466 // vmov<c> <Sn>, <Rt> 2484 // vmov<c> <Sn>, <Rt>
2467 // 2485 //
2468 // cccc1110000onnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt. 2486 // cccc11100000nnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt.
2469 constexpr const char *Vmovsr = "vmovsr"; 2487 constexpr const char *Vmovsr = "vmovsr";
2470 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr); 2488 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr);
2471 IValueT Rt = encodeGPRegister(OpRt, "Rt", Vmovsr); 2489 IValueT Rt = encodeGPRegister(OpRt, "Rt", Vmovsr);
2472 assert(Sn < RegARM32::getNumSRegs()); 2490 assert(Sn < RegARM32::getNumSRegs());
2473 assert(Rt < RegARM32::getNumGPRegs()); 2491 assert(Rt < RegARM32::getNumGPRegs());
2474 assert(CondARM32::isDefined(Cond)); 2492 assert(CondARM32::isDefined(Cond));
2475 IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B27 | B26 | 2493 IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B27 | B26 |
2476 B25 | B11 | B9 | B4 | (getXXXXInRegXXXXY(Sn) << 16) | 2494 B25 | B11 | B9 | B4 | (getXXXXInRegXXXXY(Sn) << 16) |
2477 (Rt << kRdShift) | (getYInRegXXXXY(Sn) << 7); 2495 (Rt << kRdShift) | (getYInRegXXXXY(Sn) << 7);
2478 emitInst(Encoding); 2496 emitInst(Encoding);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2647 // 2665 //
2648 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and 2666 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and
2649 // iiiiiiii=NumConsecRegs. 2667 // iiiiiiii=NumConsecRegs.
2650 constexpr IValueT VpushOpcode = 2668 constexpr IValueT VpushOpcode =
2651 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; 2669 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9;
2652 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); 2670 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs);
2653 } 2671 }
2654 2672
2655 } // end of namespace ARM32 2673 } // end of namespace ARM32
2656 } // end of namespace Ice 2674 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698