| 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 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2296 } | 2296 } |
| 2297 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 2) && | 2297 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 2) && |
| 2298 (instr->Bit(15) == 0)) { | 2298 (instr->Bit(15) == 0)) { |
| 2299 // Format(instr, "smulh 'rd, 'rn, 'rm"); | 2299 // Format(instr, "smulh 'rd, 'rn, 'rm"); |
| 2300 const int64_t rn_val = get_register(rn, R31IsZR); | 2300 const int64_t rn_val = get_register(rn, R31IsZR); |
| 2301 const int64_t rm_val = get_register(rm, R31IsZR); | 2301 const int64_t rm_val = get_register(rm, R31IsZR); |
| 2302 const __int128 res = | 2302 const __int128 res = |
| 2303 static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val); | 2303 static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val); |
| 2304 const int64_t alu_out = static_cast<int64_t>(res >> 64); | 2304 const int64_t alu_out = static_cast<int64_t>(res >> 64); |
| 2305 set_register(instr, rd, alu_out, R31IsZR); | 2305 set_register(instr, rd, alu_out, R31IsZR); |
| 2306 } else if ((instr->Bits(29, 3) == 4) && (instr->Bits(21, 3) == 5) && |
| 2307 (instr->Bit(15) == 0)) { |
| 2308 // Format(instr, "umaddl 'rd, 'rn, 'rm, 'ra"); |
| 2309 const uint64_t rn_val = static_cast<uint32_t>(get_wregister(rn, R31IsZR)); |
| 2310 const uint64_t rm_val = static_cast<uint32_t>(get_wregister(rm, R31IsZR)); |
| 2311 const uint64_t ra_val = get_register(ra, R31IsZR); |
| 2312 const uint64_t alu_out = ra_val + (rn_val * rm_val); |
| 2313 set_register(instr, rd, alu_out, R31IsZR); |
| 2306 } else { | 2314 } else { |
| 2307 UnimplementedInstruction(instr); | 2315 UnimplementedInstruction(instr); |
| 2308 } | 2316 } |
| 2309 } | 2317 } |
| 2310 | 2318 |
| 2311 | 2319 |
| 2312 void Simulator::DecodeConditionalSelect(Instr* instr) { | 2320 void Simulator::DecodeConditionalSelect(Instr* instr) { |
| 2313 const Register rd = instr->RdField(); | 2321 const Register rd = instr->RdField(); |
| 2314 const Register rn = instr->RnField(); | 2322 const Register rn = instr->RnField(); |
| 2315 const Register rm = instr->RmField(); | 2323 const Register rm = instr->RmField(); |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3246 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); | 3254 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); |
| 3247 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); | 3255 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); |
| 3248 buf->Longjmp(); | 3256 buf->Longjmp(); |
| 3249 } | 3257 } |
| 3250 | 3258 |
| 3251 } // namespace dart | 3259 } // namespace dart |
| 3252 | 3260 |
| 3253 #endif // !defined(HOST_ARCH_ARM64) | 3261 #endif // !defined(HOST_ARCH_ARM64) |
| 3254 | 3262 |
| 3255 #endif // defined TARGET_ARCH_ARM64 | 3263 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |