OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
5 // met: | 5 // met: |
6 // | 6 // |
7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
10 // copyright notice, this list of conditions and the following | 10 // copyright notice, this list of conditions and the following |
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 | 1406 |
1407 | 1407 |
1408 void Assembler::ldrsw(const Register& rt, const MemOperand& src) { | 1408 void Assembler::ldrsw(const Register& rt, const MemOperand& src) { |
1409 ASSERT(rt.Is64Bits()); | 1409 ASSERT(rt.Is64Bits()); |
1410 LoadStore(rt, src, LDRSW_x); | 1410 LoadStore(rt, src, LDRSW_x); |
1411 } | 1411 } |
1412 | 1412 |
1413 | 1413 |
1414 void Assembler::ldr(const Register& rt, uint64_t imm) { | 1414 void Assembler::ldr(const Register& rt, uint64_t imm) { |
1415 // TODO(all): Constant pool may be garbage collected. Hence we cannot store | 1415 // TODO(all): Constant pool may be garbage collected. Hence we cannot store |
1416 // TODO(all): arbitrary values in them. Manually move it for now. | 1416 // arbitrary values in them. Manually move it for now. Fix |
1417 // TODO(all): Fix MacroAssembler::Fmov when this is implemented. | 1417 // MacroAssembler::Fmov when this is implemented. |
1418 UNIMPLEMENTED(); | 1418 UNIMPLEMENTED(); |
1419 } | 1419 } |
1420 | 1420 |
1421 | 1421 |
1422 void Assembler::ldr(const FPRegister& ft, double imm) { | 1422 void Assembler::ldr(const FPRegister& ft, double imm) { |
1423 // TODO(all): Constant pool may be garbage collected. Hence we cannot store | 1423 // TODO(all): Constant pool may be garbage collected. Hence we cannot store |
1424 // TODO(all): arbitrary values in them. Manually move it for now. | 1424 // arbitrary values in them. Manually move it for now. Fix |
1425 // TODO(all): Fix MacroAssembler::Fmov when this is implemented. | 1425 // MacroAssembler::Fmov when this is implemented. |
1426 UNIMPLEMENTED(); | 1426 UNIMPLEMENTED(); |
1427 } | 1427 } |
1428 | 1428 |
| 1429 |
| 1430 void Assembler::ldr(const FPRegister& ft, float imm) { |
| 1431 // TODO(all): Constant pool may be garbage collected. Hence we cannot store |
| 1432 // arbitrary values in them. Manually move it for now. Fix |
| 1433 // MacroAssembler::Fmov when this is implemented. |
| 1434 UNIMPLEMENTED(); |
| 1435 } |
| 1436 |
1429 | 1437 |
1430 void Assembler::mov(const Register& rd, const Register& rm) { | 1438 void Assembler::mov(const Register& rd, const Register& rm) { |
1431 // Moves involving the stack pointer are encoded as add immediate with | 1439 // Moves involving the stack pointer are encoded as add immediate with |
1432 // second operand of zero. Otherwise, orr with first operand zr is | 1440 // second operand of zero. Otherwise, orr with first operand zr is |
1433 // used. | 1441 // used. |
1434 if (rd.IsSP() || rm.IsSP()) { | 1442 if (rd.IsSP() || rm.IsSP()) { |
1435 add(rd, rm, 0); | 1443 add(rd, rm, 0); |
1436 } else { | 1444 } else { |
1437 orr(rd, AppropriateZeroRegFor(rd), rm); | 1445 orr(rd, AppropriateZeroRegFor(rd), rm); |
1438 } | 1446 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 Emit(DSB | ImmBarrierDomain(domain) | ImmBarrierType(type)); | 1478 Emit(DSB | ImmBarrierDomain(domain) | ImmBarrierType(type)); |
1471 } | 1479 } |
1472 | 1480 |
1473 | 1481 |
1474 void Assembler::isb() { | 1482 void Assembler::isb() { |
1475 Emit(ISB | ImmBarrierDomain(FullSystem) | ImmBarrierType(BarrierAll)); | 1483 Emit(ISB | ImmBarrierDomain(FullSystem) | ImmBarrierType(BarrierAll)); |
1476 } | 1484 } |
1477 | 1485 |
1478 | 1486 |
1479 void Assembler::fmov(FPRegister fd, double imm) { | 1487 void Assembler::fmov(FPRegister fd, double imm) { |
1480 if (fd.Is64Bits() && IsImmFP64(imm)) { | 1488 ASSERT(fd.Is64Bits()); |
1481 Emit(FMOV_d_imm | Rd(fd) | ImmFP64(imm)); | 1489 ASSERT(IsImmFP64(imm)); |
1482 } else if (fd.Is32Bits() && IsImmFP32(imm)) { | 1490 Emit(FMOV_d_imm | Rd(fd) | ImmFP64(imm)); |
1483 Emit(FMOV_s_imm | Rd(fd) | ImmFP32(static_cast<float>(imm))); | |
1484 } else if ((imm == 0.0) && (copysign(1.0, imm) == 1.0)) { | |
1485 Register zr = AppropriateZeroRegFor(fd); | |
1486 fmov(fd, zr); | |
1487 } else { | |
1488 ldr(fd, imm); | |
1489 } | |
1490 } | 1491 } |
1491 | 1492 |
1492 | 1493 |
| 1494 void Assembler::fmov(FPRegister fd, float imm) { |
| 1495 ASSERT(fd.Is32Bits()); |
| 1496 ASSERT(IsImmFP32(imm)); |
| 1497 Emit(FMOV_s_imm | Rd(fd) | ImmFP32(imm)); |
| 1498 } |
| 1499 |
| 1500 |
1493 void Assembler::fmov(Register rd, FPRegister fn) { | 1501 void Assembler::fmov(Register rd, FPRegister fn) { |
1494 ASSERT(rd.SizeInBits() == fn.SizeInBits()); | 1502 ASSERT(rd.SizeInBits() == fn.SizeInBits()); |
1495 FPIntegerConvertOp op = rd.Is32Bits() ? FMOV_ws : FMOV_xd; | 1503 FPIntegerConvertOp op = rd.Is32Bits() ? FMOV_ws : FMOV_xd; |
1496 Emit(op | Rd(rd) | Rn(fn)); | 1504 Emit(op | Rd(rd) | Rn(fn)); |
1497 } | 1505 } |
1498 | 1506 |
1499 | 1507 |
1500 void Assembler::fmov(FPRegister fd, Register rn) { | 1508 void Assembler::fmov(FPRegister fd, Register rn) { |
1501 ASSERT(fd.SizeInBits() == rn.SizeInBits()); | 1509 ASSERT(fd.SizeInBits() == rn.SizeInBits()); |
1502 FPIntegerConvertOp op = fd.Is32Bits() ? FMOV_sw : FMOV_dx; | 1510 FPIntegerConvertOp op = fd.Is32Bits() ? FMOV_sw : FMOV_dx; |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2739 // code. | 2747 // code. |
2740 #ifdef ENABLE_DEBUGGER_SUPPORT | 2748 #ifdef ENABLE_DEBUGGER_SUPPORT |
2741 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); | 2749 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); |
2742 #endif | 2750 #endif |
2743 } | 2751 } |
2744 | 2752 |
2745 | 2753 |
2746 } } // namespace v8::internal | 2754 } } // namespace v8::internal |
2747 | 2755 |
2748 #endif // V8_TARGET_ARCH_A64 | 2756 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |