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 "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 5112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5123 // Correct MOD result: | 5123 // Correct MOD result: |
5124 // res = left % right; | 5124 // res = left % right; |
5125 // if (res < 0) { | 5125 // if (res < 0) { |
5126 // if (right < 0) { | 5126 // if (right < 0) { |
5127 // res = res - right; | 5127 // res = res - right; |
5128 // } else { | 5128 // } else { |
5129 // res = res + right; | 5129 // res = res + right; |
5130 // } | 5130 // } |
5131 // } | 5131 // } |
5132 Label done; | 5132 Label done; |
5133 __ CompareRegisters(result_mod, ZR);; | 5133 __ CompareRegisters(result_mod, ZR); |
5134 __ b(&done, GE); | 5134 __ b(&done, GE); |
5135 // Result is negative, adjust it. | 5135 // Result is negative, adjust it. |
5136 __ CompareRegisters(right, ZR); | 5136 __ CompareRegisters(right, ZR); |
5137 __ sub(TMP2, result_mod, Operand(right)); | 5137 __ sub(TMP2, result_mod, Operand(right)); |
5138 __ add(TMP, result_mod, Operand(right)); | 5138 __ add(TMP, result_mod, Operand(right)); |
5139 __ csel(result_mod, TMP, TMP2, GE); | 5139 __ csel(result_mod, TMP, TMP2, GE); |
5140 __ Bind(&done); | 5140 __ Bind(&done); |
5141 return; | 5141 return; |
5142 } | 5142 } |
5143 if (kind() == MergedMathInstr::kSinCos) { | 5143 if (kind() == MergedMathInstr::kSinCos) { |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5815 1, | 5815 1, |
5816 locs()); | 5816 locs()); |
5817 __ Drop(1); | 5817 __ Drop(1); |
5818 __ Pop(result); | 5818 __ Pop(result); |
5819 } | 5819 } |
5820 | 5820 |
5821 | 5821 |
5822 } // namespace dart | 5822 } // namespace dart |
5823 | 5823 |
5824 #endif // defined TARGET_ARCH_ARM64 | 5824 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |