OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdarg.h> | 5 #include <stdarg.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #if V8_TARGET_ARCH_ARM | 9 #if V8_TARGET_ARCH_ARM |
10 | 10 |
(...skipping 3709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3720 case 0xC: | 3720 case 0xC: |
3721 case 0xE: { // Load and store single precision float to memory. | 3721 case 0xE: { // Load and store single precision float to memory. |
3722 int rn = instr->RnValue(); | 3722 int rn = instr->RnValue(); |
3723 int vd = instr->VFPDRegValue(kSinglePrecision); | 3723 int vd = instr->VFPDRegValue(kSinglePrecision); |
3724 int offset = instr->Immed8Value(); | 3724 int offset = instr->Immed8Value(); |
3725 if (!instr->HasU()) { | 3725 if (!instr->HasU()) { |
3726 offset = -offset; | 3726 offset = -offset; |
3727 } | 3727 } |
3728 | 3728 |
3729 int32_t address = get_register(rn) + 4 * offset; | 3729 int32_t address = get_register(rn) + 4 * offset; |
| 3730 // Load and store address for singles must be at least four-byte |
| 3731 // aligned. |
| 3732 DCHECK((address % 4) == 0); |
3730 if (instr->HasL()) { | 3733 if (instr->HasL()) { |
3731 // Load double from memory: vldr. | 3734 // Load single from memory: vldr. |
3732 set_s_register_from_sinteger(vd, ReadW(address, instr)); | 3735 set_s_register_from_sinteger(vd, ReadW(address, instr)); |
3733 } else { | 3736 } else { |
3734 // Store double to memory: vstr. | 3737 // Store single to memory: vstr. |
3735 WriteW(address, get_sinteger_from_s_register(vd), instr); | 3738 WriteW(address, get_sinteger_from_s_register(vd), instr); |
3736 } | 3739 } |
3737 break; | 3740 break; |
3738 } | 3741 } |
3739 case 0x4: | 3742 case 0x4: |
3740 case 0x5: | 3743 case 0x5: |
3741 case 0x6: | 3744 case 0x6: |
3742 case 0x7: | 3745 case 0x7: |
3743 case 0x9: | 3746 case 0x9: |
3744 case 0xB: | 3747 case 0xB: |
(...skipping 28 matching lines...) Expand all Loading... |
3773 case 0xA: | 3776 case 0xA: |
3774 case 0xC: | 3777 case 0xC: |
3775 case 0xE: { // Load and store double to memory. | 3778 case 0xE: { // Load and store double to memory. |
3776 int rn = instr->RnValue(); | 3779 int rn = instr->RnValue(); |
3777 int vd = instr->VFPDRegValue(kDoublePrecision); | 3780 int vd = instr->VFPDRegValue(kDoublePrecision); |
3778 int offset = instr->Immed8Value(); | 3781 int offset = instr->Immed8Value(); |
3779 if (!instr->HasU()) { | 3782 if (!instr->HasU()) { |
3780 offset = -offset; | 3783 offset = -offset; |
3781 } | 3784 } |
3782 int32_t address = get_register(rn) + 4 * offset; | 3785 int32_t address = get_register(rn) + 4 * offset; |
| 3786 // Load and store address for doubles must be at least four-byte |
| 3787 // aligned. |
| 3788 DCHECK((address % 4) == 0); |
3783 if (instr->HasL()) { | 3789 if (instr->HasL()) { |
3784 // Load double from memory: vldr. | 3790 // Load double from memory: vldr. |
3785 int32_t data[] = { | 3791 int32_t data[] = { |
3786 ReadW(address, instr), | 3792 ReadW(address, instr), |
3787 ReadW(address + 4, instr) | 3793 ReadW(address + 4, instr) |
3788 }; | 3794 }; |
3789 set_d_register(vd, reinterpret_cast<uint32_t*>(data)); | 3795 set_d_register(vd, reinterpret_cast<uint32_t*>(data)); |
3790 } else { | 3796 } else { |
3791 // Store double to memory: vstr. | 3797 // Store double to memory: vstr. |
3792 uint32_t data[2]; | 3798 uint32_t data[2]; |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4309 set_register(sp, current_sp + sizeof(uintptr_t)); | 4315 set_register(sp, current_sp + sizeof(uintptr_t)); |
4310 return address; | 4316 return address; |
4311 } | 4317 } |
4312 | 4318 |
4313 } // namespace internal | 4319 } // namespace internal |
4314 } // namespace v8 | 4320 } // namespace v8 |
4315 | 4321 |
4316 #endif // USE_SIMULATOR | 4322 #endif // USE_SIMULATOR |
4317 | 4323 |
4318 #endif // V8_TARGET_ARCH_ARM | 4324 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |