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 #ifndef VM_ASSEMBLER_MIPS_H_ | 5 #ifndef VM_ASSEMBLER_MIPS_H_ |
6 #define VM_ASSEMBLER_MIPS_H_ | 6 #define VM_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_mips.h directly; use assembler.h instead. | 9 #error Do not include assembler_mips.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 } | 849 } |
850 | 850 |
851 void LoadImmediate(Register rd, int32_t value) { | 851 void LoadImmediate(Register rd, int32_t value) { |
852 ASSERT(!in_delay_slot_); | 852 ASSERT(!in_delay_slot_); |
853 if (Utils::IsInt(kImmBits, value)) { | 853 if (Utils::IsInt(kImmBits, value)) { |
854 addiu(rd, ZR, Immediate(value)); | 854 addiu(rd, ZR, Immediate(value)); |
855 } else { | 855 } else { |
856 const uint16_t low = Utils::Low16Bits(value); | 856 const uint16_t low = Utils::Low16Bits(value); |
857 const uint16_t high = Utils::High16Bits(value); | 857 const uint16_t high = Utils::High16Bits(value); |
858 lui(rd, Immediate(high)); | 858 lui(rd, Immediate(high)); |
859 ori(rd, rd, Immediate(low)); | 859 if (low != 0) { |
| 860 ori(rd, rd, Immediate(low)); |
| 861 } |
860 } | 862 } |
861 } | 863 } |
862 | 864 |
863 void LoadImmediate(DRegister rd, double value) { | 865 void LoadImmediate(DRegister rd, double value) { |
864 ASSERT(!in_delay_slot_); | 866 ASSERT(!in_delay_slot_); |
865 FRegister frd = static_cast<FRegister>(rd * 2); | 867 FRegister frd = static_cast<FRegister>(rd * 2); |
866 const int64_t ival = bit_cast<uint64_t, double>(value); | 868 const int64_t ival = bit_cast<uint64_t, double>(value); |
867 const int32_t low = Utils::Low32Bits(ival); | 869 const int32_t low = Utils::Low32Bits(ival); |
868 const int32_t high = Utils::High32Bits(ival); | 870 const int32_t high = Utils::High32Bits(ival); |
869 if (low != 0) { | 871 if (low != 0) { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 } | 1120 } |
1119 | 1121 |
1120 void Ret() { | 1122 void Ret() { |
1121 jr(RA); | 1123 jr(RA); |
1122 } | 1124 } |
1123 | 1125 |
1124 void SmiTag(Register reg) { | 1126 void SmiTag(Register reg) { |
1125 sll(reg, reg, kSmiTagSize); | 1127 sll(reg, reg, kSmiTagSize); |
1126 } | 1128 } |
1127 | 1129 |
| 1130 void SmiTag(Register dst, Register src) { |
| 1131 sll(dst, src, kSmiTagSize); |
| 1132 } |
| 1133 |
1128 void SmiUntag(Register reg) { | 1134 void SmiUntag(Register reg) { |
1129 sra(reg, reg, kSmiTagSize); | 1135 sra(reg, reg, kSmiTagSize); |
1130 } | 1136 } |
1131 | 1137 |
1132 void SmiUntag(Register dst, Register src) { | 1138 void SmiUntag(Register dst, Register src) { |
1133 sra(dst, src, kSmiTagSize); | 1139 sra(dst, src, kSmiTagSize); |
1134 } | 1140 } |
1135 | 1141 |
1136 void LoadFromOffset(Register reg, Register base, int32_t offset) { | 1142 void LoadFromOffset(Register reg, Register base, int32_t offset) { |
1137 ASSERT(!in_delay_slot_); | 1143 ASSERT(!in_delay_slot_); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 Register value, | 1385 Register value, |
1380 Label* no_update); | 1386 Label* no_update); |
1381 | 1387 |
1382 DISALLOW_ALLOCATION(); | 1388 DISALLOW_ALLOCATION(); |
1383 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1389 DISALLOW_COPY_AND_ASSIGN(Assembler); |
1384 }; | 1390 }; |
1385 | 1391 |
1386 } // namespace dart | 1392 } // namespace dart |
1387 | 1393 |
1388 #endif // VM_ASSEMBLER_MIPS_H_ | 1394 #endif // VM_ASSEMBLER_MIPS_H_ |
OLD | NEW |