| 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::vsubs(const Operand *OpSd, const Operand *OpSn, |
| 2075 const Operand *OpSm, CondARM32::Cond Cond) { |
| 2076 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: |
| 2077 // vsub<c>.f32 <Sd>, <Sn>, <Sm> |
| 2078 // |
| 2079 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, |
| 2080 // and mmmmM=Rm. |
| 2081 constexpr const char *Vadds = "vsubs"; |
| 2082 IValueT Sd = encodeSRegister(OpSd, "Sd", Vadds); |
| 2083 IValueT Sn = encodeSRegister(OpSn, "Sn", Vadds); |
| 2084 IValueT Sm = encodeSRegister(OpSm, "Sm", Vadds); |
| 2085 constexpr IValueT VaddsOpcode = B21 | B20 | B6; |
| 2086 emitVFPsss(Cond, VaddsOpcode, Sd, Sn, Sm); |
| 2087 } |
| 2088 |
| 2089 void AssemblerARM32::vsubd(const Operand *OpDd, const Operand *OpDn, |
| 2090 const Operand *OpDm, CondARM32::Cond Cond) { |
| 2091 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: |
| 2092 // vadd<c>.f64 <Dd>, <Dn>, <Dm> |
| 2093 // |
| 2094 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, |
| 2095 // and Mmmmm=Rm. |
| 2096 constexpr const char *Vaddd = "vsubd"; |
| 2097 IValueT Dd = encodeDRegister(OpDd, "Dd", Vaddd); |
| 2098 IValueT Dn = encodeDRegister(OpDn, "Dn", Vaddd); |
| 2099 IValueT Dm = encodeDRegister(OpDm, "Dm", Vaddd); |
| 2100 constexpr IValueT VadddOpcode = B21 | B20 | B6; |
| 2101 emitVFPddd(Cond, VadddOpcode, Dd, Dn, Dm); |
| 2102 } |
| 2103 |
| 2074 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode, | 2104 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode, |
| 2075 const Variable *OpBaseReg, | 2105 const Variable *OpBaseReg, |
| 2076 SizeT NumConsecRegs) { | 2106 SizeT NumConsecRegs) { |
| 2077 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg); | 2107 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg); |
| 2078 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register. | 2108 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register. |
| 2079 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register. | 2109 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register. |
| 2080 assert(0 < NumConsecRegs); | 2110 assert(0 < NumConsecRegs); |
| 2081 (void)VpushVpopMaxConsecRegs; | 2111 (void)VpushVpopMaxConsecRegs; |
| 2082 assert(NumConsecRegs <= VpushVpopMaxConsecRegs); | 2112 assert(NumConsecRegs <= VpushVpopMaxConsecRegs); |
| 2083 assert((BaseReg + NumConsecRegs) <= RegARM32::getNumSRegs()); | 2113 assert((BaseReg + NumConsecRegs) <= RegARM32::getNumSRegs()); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2113 // | 2143 // |
| 2114 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and | 2144 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and |
| 2115 // iiiiiiii=NumConsecRegs. | 2145 // iiiiiiii=NumConsecRegs. |
| 2116 constexpr IValueT VpushOpcode = | 2146 constexpr IValueT VpushOpcode = |
| 2117 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; | 2147 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; |
| 2118 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); | 2148 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); |
| 2119 } | 2149 } |
| 2120 | 2150 |
| 2121 } // end of namespace ARM32 | 2151 } // end of namespace ARM32 |
| 2122 } // end of namespace Ice | 2152 } // end of namespace Ice |
| OLD | NEW |