| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This is forked from Dart revision df52deea9f25690eb8b66c5995da92b70f7ac1fe | 5 // This is forked from Dart revision df52deea9f25690eb8b66c5995da92b70f7ac1fe |
| 6 // Please update the (git) revision if we merge changes from Dart. | 6 // Please update the (git) revision if we merge changes from Dart. |
| 7 // https://code.google.com/p/dart/wiki/GettingTheSource | 7 // https://code.google.com/p/dart/wiki/GettingTheSource |
| 8 | 8 |
| 9 #ifndef VM_ASSEMBLER_ARM_H_ | 9 #ifndef VM_ASSEMBLER_ARM_H_ |
| 10 #define VM_ASSEMBLER_ARM_H_ | 10 #define VM_ASSEMBLER_ARM_H_ |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 encoding_ = (rotate << kRotateShift) | (immed8 << kImmed8Shift); | 151 encoding_ = (rotate << kRotateShift) | (immed8 << kImmed8Shift); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Moved to decodeOperand() in IceAssemblerARM32.cpp | 154 // Moved to decodeOperand() in IceAssemblerARM32.cpp |
| 155 // Data-processing operands - Register. | 155 // Data-processing operands - Register. |
| 156 explicit Operand(Register rm) { | 156 explicit Operand(Register rm) { |
| 157 type_ = 0; | 157 type_ = 0; |
| 158 encoding_ = static_cast<uint32_t>(rm); | 158 encoding_ = static_cast<uint32_t>(rm); |
| 159 } | 159 } |
| 160 | 160 |
| 161 // Moved to encodeShiftRotateImm5() | 161 // Moved to encodeShiftRotateImm5() in IceAssemblerARM32.cpp |
| 162 // Data-processing operands - Logical shift/rotate by immediate. | 162 // Data-processing operands - Logical shift/rotate by immediate. |
| 163 Operand(Register rm, Shift shift, uint32_t shift_imm) { | 163 Operand(Register rm, Shift shift, uint32_t shift_imm) { |
| 164 ASSERT(shift_imm < (1 << kShiftImmBits)); | 164 ASSERT(shift_imm < (1 << kShiftImmBits)); |
| 165 type_ = 0; | 165 type_ = 0; |
| 166 encoding_ = shift_imm << kShiftImmShift | | 166 encoding_ = shift_imm << kShiftImmShift | |
| 167 static_cast<uint32_t>(shift) << kShiftShift | | 167 static_cast<uint32_t>(shift) << kShiftShift | |
| 168 static_cast<uint32_t>(rm); | 168 static_cast<uint32_t>(rm); |
| 169 } | 169 } |
| 170 #endif | |
| 171 | 170 |
| 171 // Moved to encodeShiftRotateReg() in IceAssemblerARM32.cpp |
| 172 // Data-processing operands - Logical shift/rotate by register. | 172 // Data-processing operands - Logical shift/rotate by register. |
| 173 Operand(Register rm, Shift shift, Register rs) { | 173 Operand(Register rm, Shift shift, Register rs) { |
| 174 type_ = 0; | 174 type_ = 0; |
| 175 encoding_ = static_cast<uint32_t>(rs) << kShiftRegisterShift | | 175 encoding_ = static_cast<uint32_t>(rs) << kShiftRegisterShift | |
| 176 static_cast<uint32_t>(shift) << kShiftShift | (1 << 4) | | 176 static_cast<uint32_t>(shift) << kShiftShift | (1 << 4) | |
| 177 static_cast<uint32_t>(rm); | 177 static_cast<uint32_t>(rm); |
| 178 } | 178 } |
| 179 | 179 |
| 180 #if 0 | |
| 181 // Already defined as ARM32::OperandARM32FlexImm::canHoldImm(). | 180 // Already defined as ARM32::OperandARM32FlexImm::canHoldImm(). |
| 182 static bool CanHold(uint32_t immediate, Operand* o) { | 181 static bool CanHold(uint32_t immediate, Operand* o) { |
| 183 // Avoid the more expensive test for frequent small immediate values. | 182 // Avoid the more expensive test for frequent small immediate values. |
| 184 if (immediate < (1 << kImmed8Bits)) { | 183 if (immediate < (1 << kImmed8Bits)) { |
| 185 o->type_ = 1; | 184 o->type_ = 1; |
| 186 o->encoding_ = (0 << kRotateShift) | (immediate << kImmed8Shift); | 185 o->encoding_ = (0 << kRotateShift) | (immediate << kImmed8Shift); |
| 187 return true; | 186 return true; |
| 188 } | 187 } |
| 189 // Note that immediate must be unsigned for the test to work correctly. | 188 // Note that immediate must be unsigned for the test to work correctly. |
| 190 for (int rot = 0; rot < 16; rot++) { | 189 for (int rot = 0; rot < 16; rot++) { |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 // Moved to ARM32::AssemblerARM32::pushList(). | 948 // Moved to ARM32::AssemblerARM32::pushList(). |
| 950 void PushList(RegList regs, Condition cond = AL); | 949 void PushList(RegList regs, Condition cond = AL); |
| 951 | 950 |
| 952 // Moved to ARM32::AssemblerARM32::popList(). | 951 // Moved to ARM32::AssemblerARM32::popList(). |
| 953 void PopList(RegList regs, Condition cond = AL); | 952 void PopList(RegList regs, Condition cond = AL); |
| 954 #endif | 953 #endif |
| 955 void MoveRegister(Register rd, Register rm, Condition cond = AL); | 954 void MoveRegister(Register rd, Register rm, Condition cond = AL); |
| 956 | 955 |
| 957 // Convenience shift instructions. Use mov instruction with shifter operand | 956 // Convenience shift instructions. Use mov instruction with shifter operand |
| 958 // for variants setting the status flags. | 957 // for variants setting the status flags. |
| 958 #if 0 |
| 959 // Moved to ARM32::AssemblerARM32::lsl() |
| 959 void Lsl(Register rd, Register rm, const Operand& shift_imm, | 960 void Lsl(Register rd, Register rm, const Operand& shift_imm, |
| 960 Condition cond = AL); | 961 Condition cond = AL); |
| 962 // Moved to ARM32::AssemblerARM32::lsl() |
| 961 void Lsl(Register rd, Register rm, Register rs, Condition cond = AL); | 963 void Lsl(Register rd, Register rm, Register rs, Condition cond = AL); |
| 964 #endif |
| 962 void Lsr(Register rd, Register rm, const Operand& shift_imm, | 965 void Lsr(Register rd, Register rm, const Operand& shift_imm, |
| 963 Condition cond = AL); | 966 Condition cond = AL); |
| 964 void Lsr(Register rd, Register rm, Register rs, Condition cond = AL); | 967 void Lsr(Register rd, Register rm, Register rs, Condition cond = AL); |
| 965 void Asr(Register rd, Register rm, const Operand& shift_imm, | 968 void Asr(Register rd, Register rm, const Operand& shift_imm, |
| 966 Condition cond = AL); | 969 Condition cond = AL); |
| 967 void Asr(Register rd, Register rm, Register rs, Condition cond = AL); | 970 void Asr(Register rd, Register rm, Register rs, Condition cond = AL); |
| 968 void Asrs(Register rd, Register rm, const Operand& shift_imm, | 971 void Asrs(Register rd, Register rm, const Operand& shift_imm, |
| 969 Condition cond = AL); | 972 Condition cond = AL); |
| 970 void Ror(Register rd, Register rm, const Operand& shift_imm, | 973 void Ror(Register rd, Register rm, const Operand& shift_imm, |
| 971 Condition cond = AL); | 974 Condition cond = AL); |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 // ARM32::AssemblerARM::uxt() (uxtb and uxth). | 1314 // ARM32::AssemblerARM::uxt() (uxtb and uxth). |
| 1312 #endif | 1315 #endif |
| 1313 | 1316 |
| 1314 DISALLOW_ALLOCATION(); | 1317 DISALLOW_ALLOCATION(); |
| 1315 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1318 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 1316 }; | 1319 }; |
| 1317 | 1320 |
| 1318 } // namespace dart | 1321 } // namespace dart |
| 1319 | 1322 |
| 1320 #endif // VM_ASSEMBLER_ARM_H_ | 1323 #endif // VM_ASSEMBLER_ARM_H_ |
| OLD | NEW |