| 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 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2064 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, | 2064 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, |
| 2065 // and Mmmmm=Rm. | 2065 // and Mmmmm=Rm. |
| 2066 constexpr const char *Vaddd = "vaddd"; | 2066 constexpr const char *Vaddd = "vaddd"; |
| 2067 IValueT Dd = encodeDRegister(OpDd, "Dd", Vaddd); | 2067 IValueT Dd = encodeDRegister(OpDd, "Dd", Vaddd); |
| 2068 IValueT Dn = encodeDRegister(OpDn, "Dn", Vaddd); | 2068 IValueT Dn = encodeDRegister(OpDn, "Dn", Vaddd); |
| 2069 IValueT Dm = encodeDRegister(OpDm, "Dm", Vaddd); | 2069 IValueT Dm = encodeDRegister(OpDm, "Dm", Vaddd); |
| 2070 constexpr IValueT VadddOpcode = B21 | B20; | 2070 constexpr IValueT VadddOpcode = B21 | B20; |
| 2071 emitVFPddd(Cond, VadddOpcode, Dd, Dn, Dm); | 2071 emitVFPddd(Cond, VadddOpcode, Dd, Dn, Dm); |
| 2072 } | 2072 } |
| 2073 | 2073 |
| 2074 void AssemblerARM32::emitVFPsd(CondARM32::Cond Cond, IValueT Opcode, IValueT Sd, |
| 2075 IValueT Dm) { |
| 2076 assert(Sd < RegARM32::getNumSRegs()); |
| 2077 assert(Dm < RegARM32::getNumDRegs()); |
| 2078 assert(CondARM32::isDefined(Cond)); |
| 2079 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
| 2080 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; |
| 2081 const IValueT Encoding = |
| 2082 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | |
| 2083 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sd) << 12) | |
| 2084 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm); |
| 2085 emitInst(Encoding); |
| 2086 } |
| 2087 |
| 2088 void AssemblerARM32::vcvtsd(const Operand *OpSd, const Operand *OpDm, |
| 2089 CondARM32::Cond Cond) { |
| 2090 constexpr const char *Vcvtsd = "vctsd"; |
| 2091 IValueT Sd = encodeSRegister(OpSd, "Sd", Vcvtsd); |
| 2092 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcvtsd); |
| 2093 constexpr IValueT VcvtsdOpcode = |
| 2094 B23 | B21 | B20 | B18 | B17 | B16 | B8 | B7 | B6; |
| 2095 emitVFPsd(Cond, VcvtsdOpcode, Sd, Dm); |
| 2096 } |
| 2097 |
| 2098 void AssemblerARM32::emitVFPds(CondARM32::Cond Cond, IValueT Opcode, IValueT Dd, |
| 2099 IValueT Sm) { |
| 2100 assert(Dd < RegARM32::getNumDRegs()); |
| 2101 assert(Sm < RegARM32::getNumSRegs()); |
| 2102 assert(CondARM32::isDefined(Cond)); |
| 2103 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
| 2104 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; |
| 2105 const IValueT Encoding = |
| 2106 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | |
| 2107 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dd) << 12) | |
| 2108 (getYInRegXXXXY(Sm) << 5) | getXXXXInRegXXXXY(Sm); |
| 2109 emitInst(Encoding); |
| 2110 } |
| 2111 |
| 2112 void AssemblerARM32::vcvtds(const Operand *OpDd, const Operand *OpSm, |
| 2113 CondARM32::Cond Cond) { |
| 2114 constexpr const char *Vcvtds = "Vctds"; |
| 2115 IValueT Dd = encodeDRegister(OpDd, "Dd", Vcvtds); |
| 2116 IValueT Sm = encodeSRegister(OpSm, "Sm", Vcvtds); |
| 2117 constexpr IValueT VcvtdsOpcode = B23 | B21 | B20 | B18 | B17 | B16 | B7 | B6; |
| 2118 emitVFPds(Cond, VcvtdsOpcode, Dd, Sm); |
| 2119 } |
| 2120 |
| 2074 void AssemblerARM32::vdivs(const Operand *OpSd, const Operand *OpSn, | 2121 void AssemblerARM32::vdivs(const Operand *OpSd, const Operand *OpSn, |
| 2075 const Operand *OpSm, CondARM32::Cond Cond) { | 2122 const Operand *OpSm, CondARM32::Cond Cond) { |
| 2076 // VDIV (floating-point) - ARM section A8.8.283, encoding A2: | 2123 // VDIV (floating-point) - ARM section A8.8.283, encoding A2: |
| 2077 // vdiv<c>.f32 <Sd>, <Sn>, <Sm> | 2124 // vdiv<c>.f32 <Sd>, <Sn>, <Sm> |
| 2078 // | 2125 // |
| 2079 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, | 2126 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, |
| 2080 // and mmmmM=Rm. | 2127 // and mmmmM=Rm. |
| 2081 constexpr const char *Vdivs = "vdivs"; | 2128 constexpr const char *Vdivs = "vdivs"; |
| 2082 IValueT Sd = encodeSRegister(OpSd, "Sd", Vdivs); | 2129 IValueT Sd = encodeSRegister(OpSd, "Sd", Vdivs); |
| 2083 IValueT Sn = encodeSRegister(OpSn, "Sn", Vdivs); | 2130 IValueT Sn = encodeSRegister(OpSn, "Sn", Vdivs); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2203 // | 2250 // |
| 2204 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and | 2251 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and |
| 2205 // iiiiiiii=NumConsecRegs. | 2252 // iiiiiiii=NumConsecRegs. |
| 2206 constexpr IValueT VpushOpcode = | 2253 constexpr IValueT VpushOpcode = |
| 2207 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; | 2254 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; |
| 2208 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); | 2255 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); |
| 2209 } | 2256 } |
| 2210 | 2257 |
| 2211 } // end of namespace ARM32 | 2258 } // end of namespace ARM32 |
| 2212 } // end of namespace Ice | 2259 } // end of namespace Ice |
| OLD | NEW |