OLD | NEW |
1 | 1 |
2 // Copyright 2012 the V8 project authors. All rights reserved. | 2 // Copyright 2012 the V8 project authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 DCHECK(!tmp.is(rt)); | 1155 DCHECK(!tmp.is(rt)); |
1156 sll(tmp, rs, sa); | 1156 sll(tmp, rs, sa); |
1157 Addu(rd, rt, tmp); | 1157 Addu(rd, rt, tmp); |
1158 } | 1158 } |
1159 } | 1159 } |
1160 | 1160 |
1161 | 1161 |
1162 // ------------Pseudo-instructions------------- | 1162 // ------------Pseudo-instructions------------- |
1163 | 1163 |
1164 void MacroAssembler::Ulw(Register rd, const MemOperand& rs) { | 1164 void MacroAssembler::Ulw(Register rd, const MemOperand& rs) { |
1165 lwr(rd, rs); | 1165 if (is_int16(rs.offset()) && is_int16(rs.offset() + 3)) { |
1166 lwl(rd, MemOperand(rs.rm(), rs.offset() + 3)); | 1166 if (!rd.is(rs.rm())) { |
| 1167 lwr(rd, rs); |
| 1168 lwl(rd, MemOperand(rs.rm(), rs.offset() + 3)); |
| 1169 } else { |
| 1170 DCHECK(!rs.rm().is(at)); |
| 1171 lwr(at, rs); |
| 1172 lwl(at, MemOperand(rs.rm(), rs.offset() + 3)); |
| 1173 mov(rd, at); |
| 1174 } |
| 1175 } else { // Offset > 16 bits, use multiple instructions to load. |
| 1176 DCHECK(!rd.is(rs.rm())); |
| 1177 LoadRegPlusOffsetToAt(rs); |
| 1178 lwr(rd, MemOperand(at, 0)); |
| 1179 lwl(rd, MemOperand(at, 3)); |
| 1180 } |
1167 } | 1181 } |
1168 | 1182 |
1169 | 1183 |
1170 void MacroAssembler::Usw(Register rd, const MemOperand& rs) { | 1184 void MacroAssembler::Usw(Register rd, const MemOperand& rs) { |
1171 swr(rd, rs); | 1185 DCHECK(!rd.is(rs.rm())); |
1172 swl(rd, MemOperand(rs.rm(), rs.offset() + 3)); | 1186 if (is_int16(rs.offset()) && is_int16(rs.offset() + 3)) { |
| 1187 swr(rd, rs); |
| 1188 swl(rd, MemOperand(rs.rm(), rs.offset() + 3)); |
| 1189 } else { |
| 1190 LoadRegPlusOffsetToAt(rs); |
| 1191 swr(rd, MemOperand(at, 0)); |
| 1192 swl(rd, MemOperand(at, 3)); |
| 1193 } |
1173 } | 1194 } |
1174 | 1195 |
1175 | 1196 |
1176 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { | 1197 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { |
1177 AllowDeferredHandleDereference smi_check; | 1198 AllowDeferredHandleDereference smi_check; |
1178 if (value->IsSmi()) { | 1199 if (value->IsSmi()) { |
1179 li(dst, Operand(value), mode); | 1200 li(dst, Operand(value), mode); |
1180 } else { | 1201 } else { |
1181 DCHECK(value->IsHeapObject()); | 1202 DCHECK(value->IsHeapObject()); |
1182 if (isolate()->heap()->InNewSpace(*value)) { | 1203 if (isolate()->heap()->InNewSpace(*value)) { |
(...skipping 4837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6020 if (mag.shift > 0) sra(result, result, mag.shift); | 6041 if (mag.shift > 0) sra(result, result, mag.shift); |
6021 srl(at, dividend, 31); | 6042 srl(at, dividend, 31); |
6022 Addu(result, result, Operand(at)); | 6043 Addu(result, result, Operand(at)); |
6023 } | 6044 } |
6024 | 6045 |
6025 | 6046 |
6026 } // namespace internal | 6047 } // namespace internal |
6027 } // namespace v8 | 6048 } // namespace v8 |
6028 | 6049 |
6029 #endif // V8_TARGET_ARCH_MIPS | 6050 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |