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> // NOLINT | 5 #include <setjmp.h> // NOLINT |
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 2639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2650 const int32_t rm_val = get_wregister(rm, R31IsZR); | 2650 const int32_t rm_val = get_wregister(rm, R31IsZR); |
2651 const int32_t ra_val = get_wregister(ra, R31IsZR); | 2651 const int32_t ra_val = get_wregister(ra, R31IsZR); |
2652 const int32_t alu_out = ra_val - (rn_val * rm_val); | 2652 const int32_t alu_out = ra_val - (rn_val * rm_val); |
2653 set_wregister(rd, alu_out, R31IsZR); | 2653 set_wregister(rd, alu_out, R31IsZR); |
2654 } | 2654 } |
2655 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 2) && | 2655 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 2) && |
2656 (instr->Bit(15) == 0)) { | 2656 (instr->Bit(15) == 0)) { |
2657 // Format(instr, "smulh 'rd, 'rn, 'rm"); | 2657 // Format(instr, "smulh 'rd, 'rn, 'rm"); |
2658 const int64_t rn_val = get_register(rn, R31IsZR); | 2658 const int64_t rn_val = get_register(rn, R31IsZR); |
2659 const int64_t rm_val = get_register(rm, R31IsZR); | 2659 const int64_t rm_val = get_register(rm, R31IsZR); |
2660 #if defined(TARGET_OS_WINDOWS) | 2660 #if defined(HOST_OS_WINDOWS) |
2661 // Visual Studio does not support __int128. | 2661 // Visual Studio does not support __int128. |
2662 int64_t alu_out; | 2662 int64_t alu_out; |
2663 Multiply128(rn_val, rm_val, &alu_out); | 2663 Multiply128(rn_val, rm_val, &alu_out); |
2664 #else | 2664 #else |
2665 const __int128 res = | 2665 const __int128 res = |
2666 static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val); | 2666 static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val); |
2667 const int64_t alu_out = static_cast<int64_t>(res >> 64); | 2667 const int64_t alu_out = static_cast<int64_t>(res >> 64); |
2668 #endif // TARGET_OS_WINDOWS | 2668 #endif // HOST_OS_WINDOWS |
2669 set_register(instr, rd, alu_out, R31IsZR); | 2669 set_register(instr, rd, alu_out, R31IsZR); |
2670 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 6) && | 2670 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 6) && |
2671 (instr->Bit(15) == 0)) { | 2671 (instr->Bit(15) == 0)) { |
2672 // Format(instr, "umulh 'rd, 'rn, 'rm"); | 2672 // Format(instr, "umulh 'rd, 'rn, 'rm"); |
2673 const uint64_t rn_val = get_register(rn, R31IsZR); | 2673 const uint64_t rn_val = get_register(rn, R31IsZR); |
2674 const uint64_t rm_val = get_register(rm, R31IsZR); | 2674 const uint64_t rm_val = get_register(rm, R31IsZR); |
2675 #if defined(TARGET_OS_WINDOWS) | 2675 #if defined(HOST_OS_WINDOWS) |
2676 // Visual Studio does not support __int128. | 2676 // Visual Studio does not support __int128. |
2677 uint64_t alu_out; | 2677 uint64_t alu_out; |
2678 UnsignedMultiply128(rn_val, rm_val, &alu_out); | 2678 UnsignedMultiply128(rn_val, rm_val, &alu_out); |
2679 #else | 2679 #else |
2680 const unsigned __int128 res = static_cast<unsigned __int128>(rn_val) * | 2680 const unsigned __int128 res = static_cast<unsigned __int128>(rn_val) * |
2681 static_cast<unsigned __int128>(rm_val); | 2681 static_cast<unsigned __int128>(rm_val); |
2682 const uint64_t alu_out = static_cast<uint64_t>(res >> 64); | 2682 const uint64_t alu_out = static_cast<uint64_t>(res >> 64); |
2683 #endif // TARGET_OS_WINDOWS | 2683 #endif // HOST_OS_WINDOWS |
2684 set_register(instr, rd, alu_out, R31IsZR); | 2684 set_register(instr, rd, alu_out, R31IsZR); |
2685 } else if ((instr->Bits(29, 3) == 4) && (instr->Bits(21, 3) == 5) && | 2685 } else if ((instr->Bits(29, 3) == 4) && (instr->Bits(21, 3) == 5) && |
2686 (instr->Bit(15) == 0)) { | 2686 (instr->Bit(15) == 0)) { |
2687 // Format(instr, "umaddl 'rd, 'rn, 'rm, 'ra"); | 2687 // Format(instr, "umaddl 'rd, 'rn, 'rm, 'ra"); |
2688 const uint64_t rn_val = static_cast<uint32_t>(get_wregister(rn, R31IsZR)); | 2688 const uint64_t rn_val = static_cast<uint32_t>(get_wregister(rn, R31IsZR)); |
2689 const uint64_t rm_val = static_cast<uint32_t>(get_wregister(rm, R31IsZR)); | 2689 const uint64_t rm_val = static_cast<uint32_t>(get_wregister(rm, R31IsZR)); |
2690 const uint64_t ra_val = get_register(ra, R31IsZR); | 2690 const uint64_t ra_val = get_register(ra, R31IsZR); |
2691 const uint64_t alu_out = ra_val + (rn_val * rm_val); | 2691 const uint64_t alu_out = ra_val + (rn_val * rm_val); |
2692 set_register(instr, rd, alu_out, R31IsZR); | 2692 set_register(instr, rd, alu_out, R31IsZR); |
2693 } else { | 2693 } else { |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3647 set_register(NULL, CODE_REG, code); | 3647 set_register(NULL, CODE_REG, code); |
3648 set_register(NULL, PP, pp); | 3648 set_register(NULL, PP, pp); |
3649 buf->Longjmp(); | 3649 buf->Longjmp(); |
3650 } | 3650 } |
3651 | 3651 |
3652 } // namespace dart | 3652 } // namespace dart |
3653 | 3653 |
3654 #endif // !defined(USING_SIMULATOR) | 3654 #endif // !defined(USING_SIMULATOR) |
3655 | 3655 |
3656 #endif // defined TARGET_ARCH_ARM64 | 3656 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |