| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 4913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4924 const int32_t shift = | 4924 const int32_t shift = |
| 4925 reinterpret_cast<int32_t>(locs()->in(1).constant().raw()) >> 1; | 4925 reinterpret_cast<int32_t>(locs()->in(1).constant().raw()) >> 1; |
| 4926 switch (op_kind()) { | 4926 switch (op_kind()) { |
| 4927 case Token::kSHR: { | 4927 case Token::kSHR: { |
| 4928 if (shift < 32) { | 4928 if (shift < 32) { |
| 4929 __ sll(out_lo, left_hi, 32 - shift); | 4929 __ sll(out_lo, left_hi, 32 - shift); |
| 4930 __ srl(TMP, left_lo, shift); | 4930 __ srl(TMP, left_lo, shift); |
| 4931 __ or_(out_lo, out_lo, TMP); | 4931 __ or_(out_lo, out_lo, TMP); |
| 4932 __ sra(out_hi, left_hi, shift); | 4932 __ sra(out_hi, left_hi, shift); |
| 4933 } else { | 4933 } else { |
| 4934 __ sra(out_lo, left_hi, shift - 32); | 4934 if (shift == 32) { |
| 4935 __ mov(out_lo, left_hi); |
| 4936 } else if (shift < 64) { |
| 4937 __ sra(out_lo, left_hi, shift - 32); |
| 4938 } else { |
| 4939 __ sra(out_lo, left_hi, 31); |
| 4940 } |
| 4935 __ sra(out_hi, left_hi, 31); | 4941 __ sra(out_hi, left_hi, 31); |
| 4936 } | 4942 } |
| 4937 break; | 4943 break; |
| 4938 } | 4944 } |
| 4939 case Token::kSHL: { | 4945 case Token::kSHL: { |
| 4946 ASSERT(shift < 64); |
| 4940 if (shift < 32) { | 4947 if (shift < 32) { |
| 4941 __ srl(out_hi, left_lo, 32 - shift); | 4948 __ srl(out_hi, left_lo, 32 - shift); |
| 4942 __ sll(TMP, left_hi, shift); | 4949 __ sll(TMP, left_hi, shift); |
| 4943 __ or_(out_hi, out_hi, TMP); | 4950 __ or_(out_hi, out_hi, TMP); |
| 4944 __ sll(out_lo, left_lo, shift); | 4951 __ sll(out_lo, left_lo, shift); |
| 4945 } else { | 4952 } else { |
| 4946 __ sll(out_hi, left_lo, shift - 32); | 4953 __ sll(out_hi, left_lo, shift - 32); |
| 4947 __ mov(out_lo, ZR); | 4954 __ mov(out_lo, ZR); |
| 4948 } | 4955 } |
| 4949 // Check for overflow. | 4956 // Check for overflow. |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5596 1, | 5603 1, |
| 5597 locs()); | 5604 locs()); |
| 5598 __ lw(result, Address(SP, 1 * kWordSize)); | 5605 __ lw(result, Address(SP, 1 * kWordSize)); |
| 5599 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5606 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 5600 } | 5607 } |
| 5601 | 5608 |
| 5602 | 5609 |
| 5603 } // namespace dart | 5610 } // namespace dart |
| 5604 | 5611 |
| 5605 #endif // defined TARGET_ARCH_MIPS | 5612 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |