Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <setjmp.h> | 5 #include <setjmp.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #if defined(TARGET_ARCH_ARM64) | 9 #if defined(TARGET_ARCH_ARM64) |
| 10 | 10 |
| (...skipping 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2742 } | 2742 } |
| 2743 } | 2743 } |
| 2744 | 2744 |
| 2745 | 2745 |
| 2746 void Simulator::DecodeFPIntCvt(Instr* instr) { | 2746 void Simulator::DecodeFPIntCvt(Instr* instr) { |
| 2747 const VRegister vd = instr->VdField(); | 2747 const VRegister vd = instr->VdField(); |
| 2748 const VRegister vn = instr->VnField(); | 2748 const VRegister vn = instr->VnField(); |
| 2749 const Register rd = instr->RdField(); | 2749 const Register rd = instr->RdField(); |
| 2750 const Register rn = instr->RnField(); | 2750 const Register rn = instr->RnField(); |
| 2751 | 2751 |
| 2752 if ((instr->SFField() != 1) || (instr->Bit(29) != 0) || | 2752 if ((instr->Bit(29) != 0) || (instr->Bits(22, 2) != 1)) { |
| 2753 (instr->Bits(22, 2) != 1)) { | |
| 2754 UnimplementedInstruction(instr); | 2753 UnimplementedInstruction(instr); |
| 2755 return; | 2754 return; |
| 2756 } | 2755 } |
| 2757 if (instr->Bits(16, 5) == 2) { | 2756 if (instr->Bits(16, 5) == 2) { |
| 2758 // Format(instr, "scvtfd 'vd, 'vn"); | 2757 // Format(instr, "scvtfd'sf 'vd, 'vn"); |
| 2759 const int64_t rn_val = get_register(rn, instr->RnMode()); | 2758 const int64_t rn_val64 = get_register(rn, instr->RnMode()); |
| 2760 const double vn_dbl = static_cast<double>(rn_val); | 2759 const int32_t rn_val32 = get_wregister(rn, instr->RnMode()); |
| 2760 const double vn_dbl = (instr->SFField() == 1) ? | |
| 2761 static_cast<double>(rn_val64) : static_cast<double>(rn_val32); | |
| 2761 set_vregisterd(vd, 0, bit_cast<int64_t, double>(vn_dbl)); | 2762 set_vregisterd(vd, 0, bit_cast<int64_t, double>(vn_dbl)); |
| 2762 set_vregisterd(vd, 1, 0); | 2763 set_vregisterd(vd, 1, 0); |
| 2763 } else if (instr->Bits(16, 5) == 6) { | 2764 return; |
| 2764 // Format(instr, "fmovrd 'rd, 'vn"); | 2765 } |
| 2766 if (instr->SFField() == 0) { | |
|
zra
2014/10/09 19:21:51
I'd merge this check with the condition at the top
Cutch
2014/10/09 20:48:22
Done.
| |
| 2767 UnimplementedInstruction(instr); | |
| 2768 return; | |
| 2769 } | |
| 2770 if (instr->Bits(16, 5) == 6) { | |
| 2771 // Format(instr, "fmovrd'sf 'rd, 'vn"); | |
| 2765 const int64_t vn_val = get_vregisterd(vn, 0); | 2772 const int64_t vn_val = get_vregisterd(vn, 0); |
| 2766 set_register(instr, rd, vn_val, R31IsZR); | 2773 set_register(instr, rd, vn_val, R31IsZR); |
| 2767 } else if (instr->Bits(16, 5) == 7) { | 2774 } else if (instr->Bits(16, 5) == 7) { |
| 2768 // Format(instr, "fmovdr 'vd, 'rn"); | 2775 // Format(instr, "fmovdr'sf 'vd, 'rn"); |
| 2769 const int64_t rn_val = get_register(rn, R31IsZR); | 2776 const int64_t rn_val = get_register(rn, R31IsZR); |
| 2770 set_vregisterd(vd, 0, rn_val); | 2777 set_vregisterd(vd, 0, rn_val); |
| 2771 set_vregisterd(vd, 1, 0); | 2778 set_vregisterd(vd, 1, 0); |
| 2772 } else if (instr->Bits(16, 5) == 24) { | 2779 } else if (instr->Bits(16, 5) == 24) { |
| 2773 // Format(instr, "fcvtzds 'rd, 'vn"); | 2780 // Format(instr, "fcvtzds'sf 'rd, 'vn"); |
| 2774 const double vn_val = bit_cast<double, int64_t>(get_vregisterd(vn, 0)); | 2781 const double vn_val = bit_cast<double, int64_t>(get_vregisterd(vn, 0)); |
| 2775 set_register(instr, rd, static_cast<int64_t>(vn_val), instr->RdMode()); | 2782 set_register(instr, rd, static_cast<int64_t>(vn_val), instr->RdMode()); |
| 2776 } else { | 2783 } else { |
| 2777 UnimplementedInstruction(instr); | 2784 UnimplementedInstruction(instr); |
| 2778 } | 2785 } |
| 2779 } | 2786 } |
| 2780 | 2787 |
| 2781 | 2788 |
| 2782 void Simulator::DecodeFPOneSource(Instr* instr) { | 2789 void Simulator::DecodeFPOneSource(Instr* instr) { |
| 2783 const int opc = instr->Bits(15, 6); | 2790 const int opc = instr->Bits(15, 6); |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3139 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); | 3146 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); |
| 3140 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); | 3147 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); |
| 3141 buf->Longjmp(); | 3148 buf->Longjmp(); |
| 3142 } | 3149 } |
| 3143 | 3150 |
| 3144 } // namespace dart | 3151 } // namespace dart |
| 3145 | 3152 |
| 3146 #endif // !defined(HOST_ARCH_ARM64) | 3153 #endif // !defined(HOST_ARCH_ARM64) |
| 3147 | 3154 |
| 3148 #endif // defined TARGET_ARCH_ARM64 | 3155 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |