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 <math.h> // for isnan. | 5 #include <math.h> // for isnan. |
6 #include <setjmp.h> | 6 #include <setjmp.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #if defined(TARGET_ARCH_ARM64) | 10 #if defined(TARGET_ARCH_ARM64) |
(...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 break; | 2203 break; |
2204 case 2: | 2204 case 2: |
2205 // Format(instr, "faddd 'vd, 'vn, 'vm"); | 2205 // Format(instr, "faddd 'vd, 'vn, 'vm"); |
2206 result = vn_val + vm_val; | 2206 result = vn_val + vm_val; |
2207 break; | 2207 break; |
2208 case 3: | 2208 case 3: |
2209 // Format(instr, "fsubd 'vd, 'vn, 'vm"); | 2209 // Format(instr, "fsubd 'vd, 'vn, 'vm"); |
2210 result = vn_val - vm_val; | 2210 result = vn_val - vm_val; |
2211 break; | 2211 break; |
2212 default: | 2212 default: |
2213 // Unknown(instr); | 2213 UnimplementedInstruction(instr); |
2214 break; | 2214 return; |
2215 } | 2215 } |
2216 | 2216 |
2217 set_vregisterd(vd, bit_cast<int64_t, double>(result)); | 2217 set_vregisterd(vd, bit_cast<int64_t, double>(result)); |
2218 } | 2218 } |
2219 | 2219 |
2220 | 2220 |
2221 void Simulator::DecodeFPCompare(Instr* instr) { | 2221 void Simulator::DecodeFPCompare(Instr* instr) { |
2222 const VRegister vn = instr->VnField(); | 2222 const VRegister vn = instr->VnField(); |
2223 const VRegister vm = instr->VmField(); | 2223 const VRegister vm = instr->VmField(); |
2224 const double vn_val = get_vregisterd(vn); | 2224 const double vn_val = bit_cast<double, int64_t>(get_vregisterd(vn)); |
2225 double vm_val; | 2225 double vm_val; |
2226 | 2226 |
2227 if ((instr->Bit(22) == 1) && (instr->Bits(3, 2) == 0)) { | 2227 if ((instr->Bit(22) == 1) && (instr->Bits(3, 2) == 0)) { |
2228 // Format(instr, "fcmpd 'vn, 'vm"); | 2228 // Format(instr, "fcmpd 'vn, 'vm"); |
2229 vm_val = get_vregisterd(vm); | 2229 vm_val = bit_cast<double, int64_t>(get_vregisterd(vm)); |
2230 } else if ((instr->Bit(22) == 1) && (instr->Bits(3, 2) == 1)) { | 2230 } else if ((instr->Bit(22) == 1) && (instr->Bits(3, 2) == 1)) { |
2231 if (instr->VmField() == V0) { | 2231 if (instr->VmField() == V0) { |
2232 // Format(instr, "fcmpd 'vn, #0.0"); | 2232 // Format(instr, "fcmpd 'vn, #0.0"); |
2233 vm_val = 0.0; | 2233 vm_val = 0.0; |
2234 } else { | 2234 } else { |
2235 UnimplementedInstruction(instr); | 2235 UnimplementedInstruction(instr); |
2236 return; | 2236 return; |
2237 } | 2237 } |
2238 } else { | 2238 } else { |
2239 UnimplementedInstruction(instr); | 2239 UnimplementedInstruction(instr); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2472 set_register(kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); | 2472 set_register(kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); |
2473 set_register(kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); | 2473 set_register(kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); |
2474 buf->Longjmp(); | 2474 buf->Longjmp(); |
2475 } | 2475 } |
2476 | 2476 |
2477 } // namespace dart | 2477 } // namespace dart |
2478 | 2478 |
2479 #endif // !defined(HOST_ARCH_ARM64) | 2479 #endif // !defined(HOST_ARCH_ARM64) |
2480 | 2480 |
2481 #endif // defined TARGET_ARCH_ARM64 | 2481 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |