Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: runtime/vm/simulator_arm64.cc

Issue 2628043006: Fix simarm64 bugs on Windows. (Closed)
Patch Set: address comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/constants_arm64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2638 matching lines...) Expand 10 before | Expand all | Expand 10 after
2649 const int32_t rm_val = get_wregister(rm, R31IsZR); 2649 const int32_t rm_val = get_wregister(rm, R31IsZR);
2650 const int32_t ra_val = get_wregister(ra, R31IsZR); 2650 const int32_t ra_val = get_wregister(ra, R31IsZR);
2651 const int32_t alu_out = ra_val - (rn_val * rm_val); 2651 const int32_t alu_out = ra_val - (rn_val * rm_val);
2652 set_wregister(rd, alu_out, R31IsZR); 2652 set_wregister(rd, alu_out, R31IsZR);
2653 } 2653 }
2654 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 2) && 2654 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 2) &&
2655 (instr->Bit(15) == 0)) { 2655 (instr->Bit(15) == 0)) {
2656 // Format(instr, "smulh 'rd, 'rn, 'rm"); 2656 // Format(instr, "smulh 'rd, 'rn, 'rm");
2657 const int64_t rn_val = get_register(rn, R31IsZR); 2657 const int64_t rn_val = get_register(rn, R31IsZR);
2658 const int64_t rm_val = get_register(rm, R31IsZR); 2658 const int64_t rm_val = get_register(rm, R31IsZR);
2659 #if defined(TARGET_OS_WINDOWS)
2660 // Visual Studio does not support __int128.
2661 int64_t alu_out;
2662 Multiply128(rn_val, rm_val, &alu_out);
2663 #else
2659 const __int128 res = 2664 const __int128 res =
2660 static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val); 2665 static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val);
2661 const int64_t alu_out = static_cast<int64_t>(res >> 64); 2666 const int64_t alu_out = static_cast<int64_t>(res >> 64);
2667 #endif // TARGET_OS_WINDOWS
2662 set_register(instr, rd, alu_out, R31IsZR); 2668 set_register(instr, rd, alu_out, R31IsZR);
2663 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 6) && 2669 } else if ((instr->Bits(29, 2) == 0) && (instr->Bits(21, 3) == 6) &&
2664 (instr->Bit(15) == 0)) { 2670 (instr->Bit(15) == 0)) {
2665 // Format(instr, "umulh 'rd, 'rn, 'rm"); 2671 // Format(instr, "umulh 'rd, 'rn, 'rm");
2666 const uint64_t rn_val = get_register(rn, R31IsZR); 2672 const uint64_t rn_val = get_register(rn, R31IsZR);
2667 const uint64_t rm_val = get_register(rm, R31IsZR); 2673 const uint64_t rm_val = get_register(rm, R31IsZR);
2674 #if defined(TARGET_OS_WINDOWS)
2675 // Visual Studio does not support __int128.
2676 int64_t alu_out;
2677 Multiply128(rn_val, rm_val, &alu_out);
2678 #else
2668 const __int128 res = 2679 const __int128 res =
2669 static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val); 2680 static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val);
2670 const int64_t alu_out = static_cast<int64_t>(res >> 64); 2681 const int64_t alu_out = static_cast<int64_t>(res >> 64);
2682 #endif // TARGET_OS_WINDOWS
2671 set_register(instr, rd, alu_out, R31IsZR); 2683 set_register(instr, rd, alu_out, R31IsZR);
2672 } else if ((instr->Bits(29, 3) == 4) && (instr->Bits(21, 3) == 5) && 2684 } else if ((instr->Bits(29, 3) == 4) && (instr->Bits(21, 3) == 5) &&
2673 (instr->Bit(15) == 0)) { 2685 (instr->Bit(15) == 0)) {
2674 // Format(instr, "umaddl 'rd, 'rn, 'rm, 'ra"); 2686 // Format(instr, "umaddl 'rd, 'rn, 'rm, 'ra");
2675 const uint64_t rn_val = static_cast<uint32_t>(get_wregister(rn, R31IsZR)); 2687 const uint64_t rn_val = static_cast<uint32_t>(get_wregister(rn, R31IsZR));
2676 const uint64_t rm_val = static_cast<uint32_t>(get_wregister(rm, R31IsZR)); 2688 const uint64_t rm_val = static_cast<uint32_t>(get_wregister(rm, R31IsZR));
2677 const uint64_t ra_val = get_register(ra, R31IsZR); 2689 const uint64_t ra_val = get_register(ra, R31IsZR);
2678 const uint64_t alu_out = ra_val + (rn_val * rm_val); 2690 const uint64_t alu_out = ra_val + (rn_val * rm_val);
2679 set_register(instr, rd, alu_out, R31IsZR); 2691 set_register(instr, rd, alu_out, R31IsZR);
2680 } else { 2692 } else {
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
3634 set_register(NULL, CODE_REG, code); 3646 set_register(NULL, CODE_REG, code);
3635 set_register(NULL, PP, pp); 3647 set_register(NULL, PP, pp);
3636 buf->Longjmp(); 3648 buf->Longjmp();
3637 } 3649 }
3638 3650
3639 } // namespace dart 3651 } // namespace dart
3640 3652
3641 #endif // !defined(USING_SIMULATOR) 3653 #endif // !defined(USING_SIMULATOR)
3642 3654
3643 #endif // defined TARGET_ARCH_ARM64 3655 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/constants_arm64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698