| 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/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 4562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4573 __ cund(exp, exp); | 4573 __ cund(exp, exp); |
| 4574 Label try_sqrt; | 4574 Label try_sqrt; |
| 4575 __ bc1f(&try_sqrt); // Neither 'exp' nor 'base' are NaN. | 4575 __ bc1f(&try_sqrt); // Neither 'exp' nor 'base' are NaN. |
| 4576 | 4576 |
| 4577 __ Bind(&return_nan); | 4577 __ Bind(&return_nan); |
| 4578 __ LoadImmediate(result, NAN); | 4578 __ LoadImmediate(result, NAN); |
| 4579 __ b(&skip_call); | 4579 __ b(&skip_call); |
| 4580 | 4580 |
| 4581 __ Bind(&try_sqrt); | 4581 __ Bind(&try_sqrt); |
| 4582 // Before calling pow, check if we could use sqrt instead of pow. | 4582 // Before calling pow, check if we could use sqrt instead of pow. |
| 4583 __ LoadImmediate(result, kPosInfinity); | 4583 __ LoadImmediate(result, kNegInfinity); |
| 4584 // base == Infinity -> call pow; | 4584 // base == -Infinity -> call pow; |
| 4585 __ ceqd(base, result); | 4585 __ ceqd(base, result); |
| 4586 Label do_pow; | 4586 Label do_pow; |
| 4587 __ bc1t(&do_pow); | 4587 __ bc1t(&do_pow); |
| 4588 | 4588 |
| 4589 // exponent == 0.5 ? | 4589 // exponent == 0.5 ? |
| 4590 __ LoadImmediate(result, 0.5); | 4590 __ LoadImmediate(result, 0.5); |
| 4591 __ ceqd(base, result); | 4591 __ ceqd(exp, result); |
| 4592 __ bc1f(&do_pow); | 4592 __ bc1f(&do_pow); |
| 4593 | 4593 |
| 4594 // base == 0 -> return 0; | 4594 // base == 0 -> return 0; |
| 4595 __ LoadImmediate(DTMP, 0.0); | 4595 __ LoadImmediate(DTMP, 0.0); |
| 4596 __ ceqd(base, DTMP); | 4596 __ ceqd(base, DTMP); |
| 4597 Label return_zero; | 4597 Label return_zero; |
| 4598 __ bc1t(&return_zero); | 4598 __ bc1t(&return_zero); |
| 4599 | 4599 |
| 4600 __ sqrtd(result, base); | 4600 __ sqrtd(result, base); |
| 4601 __ b(&skip_call); | 4601 __ b(&skip_call); |
| (...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5832 1, | 5832 1, |
| 5833 locs()); | 5833 locs()); |
| 5834 __ lw(result, Address(SP, 1 * kWordSize)); | 5834 __ lw(result, Address(SP, 1 * kWordSize)); |
| 5835 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5835 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 5836 } | 5836 } |
| 5837 | 5837 |
| 5838 | 5838 |
| 5839 } // namespace dart | 5839 } // namespace dart |
| 5840 | 5840 |
| 5841 #endif // defined TARGET_ARCH_MIPS | 5841 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |