| 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 2364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2375 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 | | 2375 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 | |
| 2376 (encodeCondition(Cond) << kConditionShift) | | 2376 (encodeCondition(Cond) << kConditionShift) | |
| 2377 (getYInRegXXXXY(Sd) << 22) | | 2377 (getYInRegXXXXY(Sd) << 22) | |
| 2378 (getXXXXInRegXXXXY(Sd) << 12) | Address; | 2378 (getXXXXInRegXXXXY(Sd) << 12) | Address; |
| 2379 emitInst(Encoding); | 2379 emitInst(Encoding); |
| 2380 } | 2380 } |
| 2381 | 2381 |
| 2382 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt, | 2382 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt, |
| 2383 CondARM32::Cond Cond) { | 2383 CondARM32::Cond Cond) { |
| 2384 // VMOV (between ARM core register and single-precision register) | 2384 // VMOV (between ARM core register and single-precision register) |
| 2385 // ARM seciont A8.8.343, encoding A1. | 2385 // ARM section A8.8.343, encoding A1. |
| 2386 // | 2386 // |
| 2387 // vmov<c> <Sn>, <Rt> | 2387 // vmov<c> <Sn>, <Rt> |
| 2388 // | 2388 // |
| 2389 // cccc1110000onnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt. | 2389 // cccc1110000onnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt. |
| 2390 constexpr const char *Vmovsr = "vmovsr"; | 2390 constexpr const char *Vmovsr = "vmovsr"; |
| 2391 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr); | 2391 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr); |
| 2392 IValueT Rt = encodeGPRegister(OpRt, "Rt", Vmovsr); | 2392 IValueT Rt = encodeGPRegister(OpRt, "Rt", Vmovsr); |
| 2393 assert(Sn < RegARM32::getNumSRegs()); | 2393 assert(Sn < RegARM32::getNumSRegs()); |
| 2394 assert(Rt < RegARM32::getNumGPRegs()); | 2394 assert(Rt < RegARM32::getNumGPRegs()); |
| 2395 assert(CondARM32::isDefined(Cond)); | 2395 assert(CondARM32::isDefined(Cond)); |
| 2396 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | 2396 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
| 2397 IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B27 | B26 | | 2397 IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B27 | B26 | |
| 2398 B25 | B11 | B9 | B4 | (getXXXXInRegXXXXY(Sn) << 16) | | 2398 B25 | B11 | B9 | B4 | (getXXXXInRegXXXXY(Sn) << 16) | |
| 2399 (Rt << kRdShift) | (getYInRegXXXXY(Sn) << 7); | 2399 (Rt << kRdShift) | (getYInRegXXXXY(Sn) << 7); |
| 2400 emitInst(Encoding); | 2400 emitInst(Encoding); |
| 2401 } | 2401 } |
| 2402 | 2402 |
| 2403 void AssemblerARM32::vmrsAPSR_nzcv(CondARM32::Cond Cond) { |
| 2404 // MVRS - ARM section A*.8.348, encoding A1: |
| 2405 // vmrs<c> APSR_nzcv, FPSCR |
| 2406 // |
| 2407 // cccc111011110001tttt101000010000 where tttt=0x15 (i.e. when Rt=pc, use |
| 2408 // APSR_nzcv instead). |
| 2409 assert(CondARM32::isDefined(Cond)); |
| 2410 IValueT Encoding = B27 | B26 | B25 | B23 | B22 | B21 | B20 | B16 | B15 | B14 | |
| 2411 B13 | B12 | B11 | B9 | B4 | |
| 2412 (encodeCondition(Cond) << kConditionShift); |
| 2413 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
| 2414 emitInst(Encoding); |
| 2415 } |
| 2416 |
| 2403 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn, | 2417 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn, |
| 2404 const Operand *OpSm, CondARM32::Cond Cond) { | 2418 const Operand *OpSm, CondARM32::Cond Cond) { |
| 2405 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: | 2419 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: |
| 2406 // vmul<c>.f32 <Sd>, <Sn>, <Sm> | 2420 // vmul<c>.f32 <Sd>, <Sn>, <Sm> |
| 2407 // | 2421 // |
| 2408 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, | 2422 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, |
| 2409 // and mmmmM=Rm. | 2423 // and mmmmM=Rm. |
| 2410 constexpr const char *Vmuls = "vmuls"; | 2424 constexpr const char *Vmuls = "vmuls"; |
| 2411 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmuls); | 2425 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmuls); |
| 2412 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmuls); | 2426 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmuls); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 // | 2561 // |
| 2548 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and | 2562 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and |
| 2549 // iiiiiiii=NumConsecRegs. | 2563 // iiiiiiii=NumConsecRegs. |
| 2550 constexpr IValueT VpushOpcode = | 2564 constexpr IValueT VpushOpcode = |
| 2551 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; | 2565 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; |
| 2552 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); | 2566 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); |
| 2553 } | 2567 } |
| 2554 | 2568 |
| 2555 } // end of namespace ARM32 | 2569 } // end of namespace ARM32 |
| 2556 } // end of namespace Ice | 2570 } // end of namespace Ice |
| OLD | NEW |