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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 5126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5137 __ j(PARITY_ODD, &try_sqrt, Assembler::kNearJump); | 5137 __ j(PARITY_ODD, &try_sqrt, Assembler::kNearJump); |
5138 // Return NaN. | 5138 // Return NaN. |
5139 __ Bind(&return_nan); | 5139 __ Bind(&return_nan); |
5140 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(NAN))); | 5140 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(NAN))); |
5141 __ movsd(result, FieldAddress(temp, Double::value_offset())); | 5141 __ movsd(result, FieldAddress(temp, Double::value_offset())); |
5142 __ jmp(&skip_call); | 5142 __ jmp(&skip_call); |
5143 | 5143 |
5144 Label do_pow, return_zero; | 5144 Label do_pow, return_zero; |
5145 __ Bind(&try_sqrt); | 5145 __ Bind(&try_sqrt); |
5146 // Before calling pow, check if we could use sqrt instead of pow. | 5146 // Before calling pow, check if we could use sqrt instead of pow. |
5147 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(-INFINITY))); | 5147 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(kNegInfinity))); |
5148 __ movsd(result, FieldAddress(temp, Double::value_offset())); | 5148 __ movsd(result, FieldAddress(temp, Double::value_offset())); |
5149 // base == -Infinity -> call pow; | 5149 // base == -Infinity -> call pow; |
5150 __ comisd(base, result); | 5150 __ comisd(base, result); |
5151 __ j(EQUAL, &do_pow, Assembler::kNearJump); | 5151 __ j(EQUAL, &do_pow, Assembler::kNearJump); |
5152 | 5152 |
5153 // exponent == 0.5 ? | 5153 // exponent == 0.5 ? |
5154 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(0.5))); | 5154 __ LoadObject(temp, Double::ZoneHandle(Double::NewCanonical(0.5))); |
5155 __ movsd(result, FieldAddress(temp, Double::value_offset())); | 5155 __ movsd(result, FieldAddress(temp, Double::value_offset())); |
5156 __ comisd(exp, result); | 5156 __ comisd(exp, result); |
5157 __ j(NOT_EQUAL, &do_pow, Assembler::kNearJump); | 5157 __ j(NOT_EQUAL, &do_pow, Assembler::kNearJump); |
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6780 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6780 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
6781 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6781 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
6782 #endif | 6782 #endif |
6783 } | 6783 } |
6784 | 6784 |
6785 } // namespace dart | 6785 } // namespace dart |
6786 | 6786 |
6787 #undef __ | 6787 #undef __ |
6788 | 6788 |
6789 #endif // defined TARGET_ARCH_IA32 | 6789 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |