| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 | 1074 |
| 1075 if (use_mov_immediate_load(x, this)) { | 1075 if (use_mov_immediate_load(x, this)) { |
| 1076 Register target = rd.code() == pc.code() ? ip : rd; | 1076 Register target = rd.code() == pc.code() ? ip : rd; |
| 1077 // TODO(rmcilroy): add ARMv6 support for immediate loads. | 1077 // TODO(rmcilroy): add ARMv6 support for immediate loads. |
| 1078 ASSERT(CpuFeatures::IsSupported(ARMv7)); | 1078 ASSERT(CpuFeatures::IsSupported(ARMv7)); |
| 1079 if (!FLAG_enable_ool_constant_pool && | 1079 if (!FLAG_enable_ool_constant_pool && |
| 1080 x.must_output_reloc_info(this)) { | 1080 x.must_output_reloc_info(this)) { |
| 1081 // Make sure the movw/movt doesn't get separated. | 1081 // Make sure the movw/movt doesn't get separated. |
| 1082 BlockConstPoolFor(2); | 1082 BlockConstPoolFor(2); |
| 1083 } | 1083 } |
| 1084 emit(cond | 0x30*B20 | target.code()*B12 | | 1084 movw(target, static_cast<uint32_t>(x.imm32_ & 0xffff), cond); |
| 1085 EncodeMovwImmediate(x.imm32_ & 0xffff)); | |
| 1086 movt(target, static_cast<uint32_t>(x.imm32_) >> 16, cond); | 1085 movt(target, static_cast<uint32_t>(x.imm32_) >> 16, cond); |
| 1087 if (target.code() != rd.code()) { | 1086 if (target.code() != rd.code()) { |
| 1088 mov(rd, target, LeaveCC, cond); | 1087 mov(rd, target, LeaveCC, cond); |
| 1089 } | 1088 } |
| 1090 } else { | 1089 } else { |
| 1091 ASSERT(can_use_constant_pool()); | 1090 ASSERT(can_use_constant_pool()); |
| 1092 ConstantPoolAddEntry(rinfo); | 1091 ConstantPoolAddEntry(rinfo); |
| 1093 ldr(rd, MemOperand(FLAG_enable_ool_constant_pool ? pp : pc, 0), cond); | 1092 ldr(rd, MemOperand(FLAG_enable_ool_constant_pool ? pp : pc, 0), cond); |
| 1094 } | 1093 } |
| 1095 } | 1094 } |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1439 emit(link); | 1438 emit(link); |
| 1440 nop(dst.code()); | 1439 nop(dst.code()); |
| 1441 if (!CpuFeatures::IsSupported(ARMv7)) { | 1440 if (!CpuFeatures::IsSupported(ARMv7)) { |
| 1442 nop(dst.code()); | 1441 nop(dst.code()); |
| 1443 } | 1442 } |
| 1444 } | 1443 } |
| 1445 } | 1444 } |
| 1446 | 1445 |
| 1447 | 1446 |
| 1448 void Assembler::movw(Register reg, uint32_t immediate, Condition cond) { | 1447 void Assembler::movw(Register reg, uint32_t immediate, Condition cond) { |
| 1449 ASSERT(immediate < 0x10000); | 1448 emit(cond | 0x30*B20 | reg.code()*B12 | EncodeMovwImmediate(immediate)); |
| 1450 // May use movw if supported, but on unsupported platforms will try to use | |
| 1451 // equivalent rotated immed_8 value and other tricks before falling back to a | |
| 1452 // constant pool load. | |
| 1453 mov(reg, Operand(immediate), LeaveCC, cond); | |
| 1454 } | 1449 } |
| 1455 | 1450 |
| 1456 | 1451 |
| 1457 void Assembler::movt(Register reg, uint32_t immediate, Condition cond) { | 1452 void Assembler::movt(Register reg, uint32_t immediate, Condition cond) { |
| 1458 emit(cond | 0x34*B20 | reg.code()*B12 | EncodeMovwImmediate(immediate)); | 1453 emit(cond | 0x34*B20 | reg.code()*B12 | EncodeMovwImmediate(immediate)); |
| 1459 } | 1454 } |
| 1460 | 1455 |
| 1461 | 1456 |
| 1462 void Assembler::bic(Register dst, Register src1, const Operand& src2, | 1457 void Assembler::bic(Register dst, Register src1, const Operand& src2, |
| 1463 SBit s, Condition cond) { | 1458 SBit s, Condition cond) { |
| (...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3662 ASSERT((index_64bit == count_of_64bit_) && | 3657 ASSERT((index_64bit == count_of_64bit_) && |
| 3663 (index_code_ptr == (index_64bit + count_of_code_ptr_)) && | 3658 (index_code_ptr == (index_64bit + count_of_code_ptr_)) && |
| 3664 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) && | 3659 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) && |
| 3665 (index_32bit == (index_heap_ptr + count_of_32bit_))); | 3660 (index_32bit == (index_heap_ptr + count_of_32bit_))); |
| 3666 } | 3661 } |
| 3667 | 3662 |
| 3668 | 3663 |
| 3669 } } // namespace v8::internal | 3664 } } // namespace v8::internal |
| 3670 | 3665 |
| 3671 #endif // V8_TARGET_ARCH_ARM | 3666 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |