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 3342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3353 UNREACHABLE(); | 3353 UNREACHABLE(); |
3354 break; | 3354 break; |
3355 } | 3355 } |
3356 set_q_register(vd, q_data); | 3356 set_q_register(vd, q_data); |
3357 } | 3357 } |
3358 } else if ((instr->VLValue() == 0x1) && (instr->VCValue() == 0x1)) { | 3358 } else if ((instr->VLValue() == 0x1) && (instr->VCValue() == 0x1)) { |
3359 // vmov (scalar to ARM core register) | 3359 // vmov (scalar to ARM core register) |
3360 int vn = instr->VFPNRegValue(kDoublePrecision); | 3360 int vn = instr->VFPNRegValue(kDoublePrecision); |
3361 int rt = instr->RtValue(); | 3361 int rt = instr->RtValue(); |
3362 int opc1_opc2 = (instr->Bits(22, 21) << 2) | instr->Bits(6, 5); | 3362 int opc1_opc2 = (instr->Bits(22, 21) << 2) | instr->Bits(6, 5); |
| 3363 uint64_t data; |
| 3364 get_d_register(vn, &data); |
3363 if ((opc1_opc2 & 0xb) == 0) { | 3365 if ((opc1_opc2 & 0xb) == 0) { |
3364 // NeonS32 / NeonU32 | 3366 // NeonS32 / NeonU32 |
3365 double dn_value = get_double_from_d_register(vn); | 3367 int32_t int_data[2]; |
3366 int32_t data[2]; | 3368 memcpy(int_data, &data, sizeof(int_data)); |
3367 memcpy(data, &dn_value, 8); | 3369 set_register(rt, int_data[instr->Bit(21)]); |
3368 set_register(rt, data[instr->Bit(21)]); | |
3369 } else { | 3370 } else { |
3370 uint64_t data; | 3371 uint64_t data; |
3371 get_d_register(vn, &data); | 3372 get_d_register(vn, &data); |
3372 bool u = instr->Bit(23) != 0; | 3373 bool u = instr->Bit(23) != 0; |
3373 if ((opc1_opc2 & 0x8) != 0) { | 3374 if ((opc1_opc2 & 0x8) != 0) { |
3374 // NeonS8 / NeonU8 | 3375 // NeonS8 / NeonU8 |
3375 int i = opc1_opc2 & 0x7; | 3376 int i = opc1_opc2 & 0x7; |
3376 int shift = i * kBitsPerByte; | 3377 int shift = i * kBitsPerByte; |
3377 uint32_t scalar = (data >> shift) & 0xFFu; | 3378 uint32_t scalar = (data >> shift) & 0xFFu; |
3378 if (!u && (scalar & 0x80) != 0) scalar |= 0xffffff00; | 3379 if (!u && (scalar & 0x80) != 0) scalar |= 0xffffff00; |
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5005 set_register(sp, current_sp + sizeof(uintptr_t)); | 5006 set_register(sp, current_sp + sizeof(uintptr_t)); |
5006 return address; | 5007 return address; |
5007 } | 5008 } |
5008 | 5009 |
5009 } // namespace internal | 5010 } // namespace internal |
5010 } // namespace v8 | 5011 } // namespace v8 |
5011 | 5012 |
5012 #endif // USE_SIMULATOR | 5013 #endif // USE_SIMULATOR |
5013 | 5014 |
5014 #endif // V8_TARGET_ARCH_ARM | 5015 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |