Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 9 #if V8_TARGET_ARCH_PPC |
| 10 | 10 |
| (...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2701 case FCFID: { | 2701 case FCFID: { |
| 2702 // fcfids | 2702 // fcfids |
| 2703 int frt = instr->RTValue(); | 2703 int frt = instr->RTValue(); |
| 2704 int frb = instr->RBValue(); | 2704 int frb = instr->RBValue(); |
| 2705 double t_val = get_double_from_d_register(frb); | 2705 double t_val = get_double_from_d_register(frb); |
| 2706 int64_t* frb_val_p = reinterpret_cast<int64_t*>(&t_val); | 2706 int64_t* frb_val_p = reinterpret_cast<int64_t*>(&t_val); |
| 2707 double frt_val = static_cast<float>(*frb_val_p); | 2707 double frt_val = static_cast<float>(*frb_val_p); |
| 2708 set_d_register_from_double(frt, frt_val); | 2708 set_d_register_from_double(frt, frt_val); |
| 2709 return; | 2709 return; |
| 2710 } | 2710 } |
| 2711 case FCFIDU: { | |
| 2712 // fcfidus | |
| 2713 int frt = instr->RTValue(); | |
| 2714 int frb = instr->RBValue(); | |
| 2715 double t_val = get_double_from_d_register(frb); | |
|
titzer
2015/11/12 19:06:00
I'm not entirely certain that get_double_from_d_re
ahaas
2015/11/12 20:49:18
In my understanding the value in this register is
MTBrandyberry
2015/11/12 23:00:10
get_d_register, which returns the raw int64 bits,
MTBrandyberry
2015/11/13 18:40:38
See https://codereview.chromium.org/1445603002/ if
| |
| 2716 uint64_t* frb_val_p = reinterpret_cast<uint64_t*>(&t_val); | |
| 2717 double frt_val = static_cast<float>(*frb_val_p); | |
|
ahaas
2015/11/12 20:49:18
I think it should be float frt_val, and not double
MTBrandyberry
2015/11/12 23:00:10
PPC's only floating point register representation
| |
| 2718 set_d_register_from_double(frt, frt_val); | |
| 2719 return; | |
| 2720 } | |
| 2711 } | 2721 } |
| 2712 UNIMPLEMENTED(); // Not used by V8. | 2722 UNIMPLEMENTED(); // Not used by V8. |
| 2713 } | 2723 } |
| 2714 | 2724 |
| 2715 | 2725 |
| 2716 void Simulator::ExecuteExt4(Instruction* instr) { | 2726 void Simulator::ExecuteExt4(Instruction* instr) { |
| 2717 switch (instr->Bits(5, 1) << 1) { | 2727 switch (instr->Bits(5, 1) << 1) { |
| 2718 case FDIV: { | 2728 case FDIV: { |
| 2719 int frt = instr->RTValue(); | 2729 int frt = instr->RTValue(); |
| 2720 int fra = instr->RAValue(); | 2730 int fra = instr->RAValue(); |
| (...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3954 uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp); | 3964 uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp); |
| 3955 uintptr_t address = *stack_slot; | 3965 uintptr_t address = *stack_slot; |
| 3956 set_register(sp, current_sp + sizeof(uintptr_t)); | 3966 set_register(sp, current_sp + sizeof(uintptr_t)); |
| 3957 return address; | 3967 return address; |
| 3958 } | 3968 } |
| 3959 } // namespace internal | 3969 } // namespace internal |
| 3960 } // namespace v8 | 3970 } // namespace v8 |
| 3961 | 3971 |
| 3962 #endif // USE_SIMULATOR | 3972 #endif // USE_SIMULATOR |
| 3963 #endif // V8_TARGET_ARCH_PPC | 3973 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |