| OLD | NEW |
| 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 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2383 encodeAddress(OpAddress, Address, TInfo, RotatedImm8Div4Address); | 2383 encodeAddress(OpAddress, Address, TInfo, RotatedImm8Div4Address); |
| 2384 (void)AddressEncoding; | 2384 (void)AddressEncoding; |
| 2385 assert(AddressEncoding == EncodedAsImmRegOffset); | 2385 assert(AddressEncoding == EncodedAsImmRegOffset); |
| 2386 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 | | 2386 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 | |
| 2387 (encodeCondition(Cond) << kConditionShift) | | 2387 (encodeCondition(Cond) << kConditionShift) | |
| 2388 (getYInRegXXXXY(Sd) << 22) | | 2388 (getYInRegXXXXY(Sd) << 22) | |
| 2389 (getXXXXInRegXXXXY(Sd) << 12) | Address; | 2389 (getXXXXInRegXXXXY(Sd) << 12) | Address; |
| 2390 emitInst(Encoding); | 2390 emitInst(Encoding); |
| 2391 } | 2391 } |
| 2392 | 2392 |
| 2393 void AssemblerARM32::vmovd(const Operand *OpDd, |
| 2394 const OperandARM32FlexFpImm *OpFpImm, |
| 2395 CondARM32::Cond Cond) { |
| 2396 // VMOV (immediate) - ARM section A8.8.339, encoding A2: |
| 2397 // vmov<c>.f64 <Dd>, #<imm> |
| 2398 // |
| 2399 // cccc11101D11xxxxdddd10110000yyyy where cccc=Cond, ddddD=Sn, xxxxyyyy=imm. |
| 2400 constexpr const char *Vmovd = "vmovd"; |
| 2401 IValueT Dd = encodeSRegister(OpDd, "Dd", Vmovd); |
| 2402 IValueT Imm8 = OpFpImm->getModifiedImm(); |
| 2403 assert(Imm8 < (1 << 8)); |
| 2404 constexpr IValueT VmovsOpcode = B23 | B21 | B20 | B8; |
| 2405 IValueT OpcodePlusImm8 = VmovsOpcode | ((Imm8 >> 4) << 16) | (Imm8 & 0xf); |
| 2406 constexpr IValueT D0 = 0; |
| 2407 emitVFPddd(Cond, OpcodePlusImm8, Dd, D0, D0); |
| 2408 } |
| 2409 |
| 2410 void AssemblerARM32::vmovs(const Operand *OpSd, |
| 2411 const OperandARM32FlexFpImm *OpFpImm, |
| 2412 CondARM32::Cond Cond) { |
| 2413 // VMOV (immediate) - ARM section A8.8.339, encoding A2: |
| 2414 // vmov<c>.f32 <Sd>, #<imm> |
| 2415 // |
| 2416 // cccc11101D11xxxxdddd10100000yyyy where cccc=Cond, ddddD=Sn, xxxxyyyy=imm. |
| 2417 constexpr const char *Vmovs = "vmovs"; |
| 2418 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmovs); |
| 2419 IValueT Imm8 = OpFpImm->getModifiedImm(); |
| 2420 assert(Imm8 < (1 << 8)); |
| 2421 constexpr IValueT VmovsOpcode = B23 | B21 | B20; |
| 2422 IValueT OpcodePlusImm8 = VmovsOpcode | ((Imm8 >> 4) << 16) | (Imm8 & 0xf); |
| 2423 constexpr IValueT S0 = 0; |
| 2424 emitVFPsss(Cond, OpcodePlusImm8, Sd, S0, S0); |
| 2425 } |
| 2426 |
| 2393 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt, | 2427 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt, |
| 2394 CondARM32::Cond Cond) { | 2428 CondARM32::Cond Cond) { |
| 2395 // VMOV (between ARM core register and single-precision register) | 2429 // VMOV (between ARM core register and single-precision register) |
| 2396 // ARM section A8.8.343, encoding A1. | 2430 // ARM section A8.8.343, encoding A1. |
| 2397 // | 2431 // |
| 2398 // vmov<c> <Sn>, <Rt> | 2432 // vmov<c> <Sn>, <Rt> |
| 2399 // | 2433 // |
| 2400 // cccc1110000onnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt. | 2434 // cccc1110000onnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt. |
| 2401 constexpr const char *Vmovsr = "vmovsr"; | 2435 constexpr const char *Vmovsr = "vmovsr"; |
| 2402 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr); | 2436 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2567 // | 2601 // |
| 2568 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and | 2602 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and |
| 2569 // iiiiiiii=NumConsecRegs. | 2603 // iiiiiiii=NumConsecRegs. |
| 2570 constexpr IValueT VpushOpcode = | 2604 constexpr IValueT VpushOpcode = |
| 2571 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; | 2605 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; |
| 2572 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); | 2606 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); |
| 2573 } | 2607 } |
| 2574 | 2608 |
| 2575 } // end of namespace ARM32 | 2609 } // end of namespace ARM32 |
| 2576 } // end of namespace Ice | 2610 } // end of namespace Ice |
| OLD | NEW |