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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1645683003: Add vmov between floating point registers to ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 10 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
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 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after
2406 constexpr const char *Vmovd = "vmovd"; 2406 constexpr const char *Vmovd = "vmovd";
2407 IValueT Dd = encodeSRegister(OpDd, "Dd", Vmovd); 2407 IValueT Dd = encodeSRegister(OpDd, "Dd", Vmovd);
2408 IValueT Imm8 = OpFpImm->getModifiedImm(); 2408 IValueT Imm8 = OpFpImm->getModifiedImm();
2409 assert(Imm8 < (1 << 8)); 2409 assert(Imm8 < (1 << 8));
2410 constexpr IValueT VmovsOpcode = B23 | B21 | B20 | B8; 2410 constexpr IValueT VmovsOpcode = B23 | B21 | B20 | B8;
2411 IValueT OpcodePlusImm8 = VmovsOpcode | ((Imm8 >> 4) << 16) | (Imm8 & 0xf); 2411 IValueT OpcodePlusImm8 = VmovsOpcode | ((Imm8 >> 4) << 16) | (Imm8 & 0xf);
2412 constexpr IValueT D0 = 0; 2412 constexpr IValueT D0 = 0;
2413 emitVFPddd(Cond, OpcodePlusImm8, Dd, D0, D0); 2413 emitVFPddd(Cond, OpcodePlusImm8, Dd, D0, D0);
2414 } 2414 }
2415 2415
2416 void AssemblerARM32::vmovdd(const Operand *OpDd, const Operand *OpDm,
2417 CondARM32::Cond Cond) {
2418 // VMOV (register) - ARM section A8.8.340, encoding A2:
2419 // vmov<c>.f64 <Dd>, <Sm>
2420 //
2421 // cccc11101D110000dddd101101M0mmmm where cccc=Cond, Ddddd=Sd, and Mmmmm=Sm.
2422 constexpr const char *Vmovdd = "Vmovdd";
2423 IValueT Dd = encodeSRegister(OpDd, "Dd", Vmovdd);
2424 IValueT Dm = encodeSRegister(OpDm, "Dm", Vmovdd);
2425 constexpr IValueT VmovddOpcode = B23 | B21 | B20 | B6;
2426 constexpr IValueT D0 = 0;
2427 emitVFPddd(Cond, VmovddOpcode, Dd, D0, Dm);
2428 }
2429
2416 void AssemblerARM32::vmovs(const Operand *OpSd, 2430 void AssemblerARM32::vmovs(const Operand *OpSd,
2417 const OperandARM32FlexFpImm *OpFpImm, 2431 const OperandARM32FlexFpImm *OpFpImm,
2418 CondARM32::Cond Cond) { 2432 CondARM32::Cond Cond) {
2419 // VMOV (immediate) - ARM section A8.8.339, encoding A2: 2433 // VMOV (immediate) - ARM section A8.8.339, encoding A2:
2420 // vmov<c>.f32 <Sd>, #<imm> 2434 // vmov<c>.f32 <Sd>, #<imm>
2421 // 2435 //
2422 // cccc11101D11xxxxdddd10100000yyyy where cccc=Cond, ddddD=Sn, xxxxyyyy=imm. 2436 // cccc11101D11xxxxdddd10100000yyyy where cccc=Cond, ddddD=Sn, xxxxyyyy=imm.
2423 constexpr const char *Vmovs = "vmovs"; 2437 constexpr const char *Vmovs = "vmovs";
2424 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmovs); 2438 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmovs);
2425 IValueT Imm8 = OpFpImm->getModifiedImm(); 2439 IValueT Imm8 = OpFpImm->getModifiedImm();
2426 assert(Imm8 < (1 << 8)); 2440 assert(Imm8 < (1 << 8));
2427 constexpr IValueT VmovsOpcode = B23 | B21 | B20; 2441 constexpr IValueT VmovsOpcode = B23 | B21 | B20;
2428 IValueT OpcodePlusImm8 = VmovsOpcode | ((Imm8 >> 4) << 16) | (Imm8 & 0xf); 2442 IValueT OpcodePlusImm8 = VmovsOpcode | ((Imm8 >> 4) << 16) | (Imm8 & 0xf);
2429 constexpr IValueT S0 = 0; 2443 constexpr IValueT S0 = 0;
2430 emitVFPsss(Cond, OpcodePlusImm8, Sd, S0, S0); 2444 emitVFPsss(Cond, OpcodePlusImm8, Sd, S0, S0);
2431 } 2445 }
2432 2446
2447 void AssemblerARM32::vmovss(const Operand *OpSd, const Operand *OpSm,
2448 CondARM32::Cond Cond) {
2449 // VMOV (register) - ARM section A8.8.340, encoding A2:
2450 // vmov<c>.f32 <Sd>, <Sm>
2451 //
2452 // cccc11101D110000dddd101001M0mmmm where cccc=Cond, ddddD=Sd, and mmmmM=Sm.
2453 constexpr const char *Vmovss = "Vmovss";
2454 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmovss);
2455 IValueT Sm = encodeSRegister(OpSm, "Sm", Vmovss);
2456 constexpr IValueT VmovssOpcode = B23 | B21 | B20 | B6;
2457 constexpr IValueT S0 = 0;
2458 emitVFPsss(Cond, VmovssOpcode, Sd, S0, Sm);
2459 }
2460
2433 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt, 2461 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt,
2434 CondARM32::Cond Cond) { 2462 CondARM32::Cond Cond) {
2435 // VMOV (between ARM core register and single-precision register) 2463 // VMOV (between ARM core register and single-precision register)
2436 // ARM section A8.8.343, encoding A1. 2464 // ARM section A8.8.343, encoding A1.
2437 // 2465 //
2438 // vmov<c> <Sn>, <Rt> 2466 // vmov<c> <Sn>, <Rt>
2439 // 2467 //
2440 // cccc1110000onnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt. 2468 // cccc1110000onnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt.
2441 constexpr const char *Vmovsr = "vmovsr"; 2469 constexpr const char *Vmovsr = "vmovsr";
2442 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr); 2470 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2619 // 2647 //
2620 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and 2648 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and
2621 // iiiiiiii=NumConsecRegs. 2649 // iiiiiiii=NumConsecRegs.
2622 constexpr IValueT VpushOpcode = 2650 constexpr IValueT VpushOpcode =
2623 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; 2651 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9;
2624 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); 2652 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs);
2625 } 2653 }
2626 2654
2627 } // end of namespace ARM32 2655 } // end of namespace ARM32
2628 } // end of namespace Ice 2656 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698