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 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; | 2126 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; |
2127 const IValueT Encoding = | 2127 const IValueT Encoding = |
2128 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | | 2128 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | |
2129 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sd) << 12) | | 2129 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sd) << 12) | |
2130 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm); | 2130 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm); |
2131 emitInst(Encoding); | 2131 emitInst(Encoding); |
2132 } | 2132 } |
2133 | 2133 |
2134 void AssemblerARM32::vcvtsd(const Operand *OpSd, const Operand *OpDm, | 2134 void AssemblerARM32::vcvtsd(const Operand *OpSd, const Operand *OpDm, |
2135 CondARM32::Cond Cond) { | 2135 CondARM32::Cond Cond) { |
2136 constexpr const char *Vcvtsd = "vctsd"; | 2136 constexpr const char *Vcvtsd = "vcvtsd"; |
2137 IValueT Sd = encodeSRegister(OpSd, "Sd", Vcvtsd); | 2137 IValueT Sd = encodeSRegister(OpSd, "Sd", Vcvtsd); |
2138 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcvtsd); | 2138 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcvtsd); |
2139 constexpr IValueT VcvtsdOpcode = | 2139 constexpr IValueT VcvtsdOpcode = |
2140 B23 | B21 | B20 | B18 | B17 | B16 | B8 | B7 | B6; | 2140 B23 | B21 | B20 | B18 | B17 | B16 | B8 | B7 | B6; |
2141 emitVFPsd(Cond, VcvtsdOpcode, Sd, Dm); | 2141 emitVFPsd(Cond, VcvtsdOpcode, Sd, Dm); |
2142 } | 2142 } |
2143 | 2143 |
| 2144 void AssemblerARM32::vcvtis(const Operand *OpSd, const Operand *OpSm, |
| 2145 CondARM32::Cond Cond) { |
| 2146 // VCVT (between floating-point and integer, Floating-point) |
| 2147 // - ARM Section A8.8.306, encoding A1: |
| 2148 // vcvt<c>.s32.f32 <Sd>, <Sm> |
| 2149 // |
| 2150 // cccc11101D111101dddd10101M0mmmm where cccc=Cond, ddddD=Sd, and mmmmM=Sm. |
| 2151 constexpr const char *Vcvtis = "vcvtis"; |
| 2152 IValueT Sd = encodeSRegister(OpSd, "Sd", Vcvtis); |
| 2153 IValueT Sm = encodeSRegister(OpSm, "Sm", Vcvtis); |
| 2154 constexpr IValueT VcvtsiOpcode = B23 | B21 | B20 | B19 | B18 | B16 | B7 | B6; |
| 2155 constexpr IValueT S0 = 0; |
| 2156 emitVFPsss(Cond, VcvtsiOpcode, Sd, S0, Sm); |
| 2157 } |
| 2158 |
2144 void AssemblerARM32::emitVFPds(CondARM32::Cond Cond, IValueT Opcode, IValueT Dd, | 2159 void AssemblerARM32::emitVFPds(CondARM32::Cond Cond, IValueT Opcode, IValueT Dd, |
2145 IValueT Sm) { | 2160 IValueT Sm) { |
2146 assert(Dd < RegARM32::getNumDRegs()); | 2161 assert(Dd < RegARM32::getNumDRegs()); |
2147 assert(Sm < RegARM32::getNumSRegs()); | 2162 assert(Sm < RegARM32::getNumSRegs()); |
2148 assert(CondARM32::isDefined(Cond)); | 2163 assert(CondARM32::isDefined(Cond)); |
2149 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | 2164 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
2150 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; | 2165 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; |
2151 const IValueT Encoding = | 2166 const IValueT Encoding = |
2152 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | | 2167 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | |
2153 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dd) << 12) | | 2168 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dd) << 12) | |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2406 // | 2421 // |
2407 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and | 2422 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and |
2408 // iiiiiiii=NumConsecRegs. | 2423 // iiiiiiii=NumConsecRegs. |
2409 constexpr IValueT VpushOpcode = | 2424 constexpr IValueT VpushOpcode = |
2410 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; | 2425 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; |
2411 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); | 2426 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); |
2412 } | 2427 } |
2413 | 2428 |
2414 } // end of namespace ARM32 | 2429 } // end of namespace ARM32 |
2415 } // end of namespace Ice | 2430 } // end of namespace Ice |
OLD | NEW |