| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 } else { | 782 } else { |
| 783 srl(at, rs, rt.imm32_); | 783 srl(at, rs, rt.imm32_); |
| 784 sll(rd, rs, (0x20 - rt.imm32_) & 0x1f); | 784 sll(rd, rs, (0x20 - rt.imm32_) & 0x1f); |
| 785 or_(rd, rd, at); | 785 or_(rd, rd, at); |
| 786 } | 786 } |
| 787 } | 787 } |
| 788 } | 788 } |
| 789 } | 789 } |
| 790 | 790 |
| 791 | 791 |
| 792 void MacroAssembler::Pref(int32_t hint, const MemOperand& rs) { |
| 793 if (kArchVariant == kLoongson) { |
| 794 lw(zero_reg, rs); |
| 795 } else { |
| 796 pref(hint, rs); |
| 797 } |
| 798 } |
| 799 |
| 800 |
| 792 //------------Pseudo-instructions------------- | 801 //------------Pseudo-instructions------------- |
| 793 | 802 |
| 803 void MacroAssembler::Ulw(Register rd, const MemOperand& rs) { |
| 804 lwr(rd, rs); |
| 805 lwl(rd, MemOperand(rs.rm(), rs.offset() + 3)); |
| 806 } |
| 807 |
| 808 |
| 809 void MacroAssembler::Usw(Register rd, const MemOperand& rs) { |
| 810 swr(rd, rs); |
| 811 swl(rd, MemOperand(rs.rm(), rs.offset() + 3)); |
| 812 } |
| 813 |
| 814 |
| 794 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { | 815 void MacroAssembler::li(Register dst, Handle<Object> value, LiFlags mode) { |
| 795 AllowDeferredHandleDereference smi_check; | 816 AllowDeferredHandleDereference smi_check; |
| 796 if (value->IsSmi()) { | 817 if (value->IsSmi()) { |
| 797 li(dst, Operand(value), mode); | 818 li(dst, Operand(value), mode); |
| 798 } else { | 819 } else { |
| 799 ASSERT(value->IsHeapObject()); | 820 ASSERT(value->IsHeapObject()); |
| 800 if (isolate()->heap()->InNewSpace(*value)) { | 821 if (isolate()->heap()->InNewSpace(*value)) { |
| 801 Handle<Cell> cell = isolate()->factory()->NewCell(value); | 822 Handle<Cell> cell = isolate()->factory()->NewCell(value); |
| 802 li(dst, Operand(cell)); | 823 li(dst, Operand(cell)); |
| 803 lw(dst, FieldMemOperand(dst, Cell::kValueOffset)); | 824 lw(dst, FieldMemOperand(dst, Cell::kValueOffset)); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 | 1221 |
| 1201 if (bd == PROTECT) { | 1222 if (bd == PROTECT) { |
| 1202 nop(); | 1223 nop(); |
| 1203 } | 1224 } |
| 1204 } | 1225 } |
| 1205 | 1226 |
| 1206 | 1227 |
| 1207 void MacroAssembler::Move(FPURegister dst, double imm) { | 1228 void MacroAssembler::Move(FPURegister dst, double imm) { |
| 1208 static const DoubleRepresentation minus_zero(-0.0); | 1229 static const DoubleRepresentation minus_zero(-0.0); |
| 1209 static const DoubleRepresentation zero(0.0); | 1230 static const DoubleRepresentation zero(0.0); |
| 1210 DoubleRepresentation value(imm); | 1231 DoubleRepresentation value_rep(imm); |
| 1211 // Handle special values first. | 1232 // Handle special values first. |
| 1212 bool force_load = dst.is(kDoubleRegZero); | 1233 bool force_load = dst.is(kDoubleRegZero); |
| 1213 if (value.bits == zero.bits && !force_load) { | 1234 if (value_rep == zero && !force_load) { |
| 1214 mov_d(dst, kDoubleRegZero); | 1235 mov_d(dst, kDoubleRegZero); |
| 1215 } else if (value.bits == minus_zero.bits && !force_load) { | 1236 } else if (value_rep == minus_zero && !force_load) { |
| 1216 neg_d(dst, kDoubleRegZero); | 1237 neg_d(dst, kDoubleRegZero); |
| 1217 } else { | 1238 } else { |
| 1218 uint32_t lo, hi; | 1239 uint32_t lo, hi; |
| 1219 DoubleAsTwoUInt32(imm, &lo, &hi); | 1240 DoubleAsTwoUInt32(imm, &lo, &hi); |
| 1220 // Move the low part of the double into the lower of the corresponding FPU | 1241 // Move the low part of the double into the lower of the corresponding FPU |
| 1221 // register of FPU register pair. | 1242 // register of FPU register pair. |
| 1222 if (lo != 0) { | 1243 if (lo != 0) { |
| 1223 li(at, Operand(lo)); | 1244 li(at, Operand(lo)); |
| 1224 mtc1(at, dst); | 1245 mtc1(at, dst); |
| 1225 } else { | 1246 } else { |
| (...skipping 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5764 opcode == BGTZL); | 5785 opcode == BGTZL); |
| 5765 opcode = (cond == eq) ? BEQ : BNE; | 5786 opcode = (cond == eq) ? BEQ : BNE; |
| 5766 instr = (instr & ~kOpcodeMask) | opcode; | 5787 instr = (instr & ~kOpcodeMask) | opcode; |
| 5767 masm_.emit(instr); | 5788 masm_.emit(instr); |
| 5768 } | 5789 } |
| 5769 | 5790 |
| 5770 | 5791 |
| 5771 } } // namespace v8::internal | 5792 } } // namespace v8::internal |
| 5772 | 5793 |
| 5773 #endif // V8_TARGET_ARCH_MIPS | 5794 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |