Index: runtime/vm/intrinsifier_ia32.cc |
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc |
index b9ea3a19f671a6678add2fa67f781d6402924614..a114996a53e0f6984f3bcc06f73083ca0b1a31d7 100644 |
--- a/runtime/vm/intrinsifier_ia32.cc |
+++ b/runtime/vm/intrinsifier_ia32.cc |
@@ -1566,6 +1566,30 @@ void Intrinsifier::Double_getIsNaN(Assembler* assembler) { |
} |
+void Intrinsifier::Double_getIsInfinite(Assembler* assembler) { |
+ Label not_inf; |
+ __ movl(EAX, Address(ESP, +1 * kWordSize)); |
+ __ movl(EBX, FieldAddress(EAX, Double::value_offset())); |
+ |
+ // If the low word isn't zero, then it isn't infinity. |
+ __ cmpl(EBX, Immediate(0)); |
+ __ j(NOT_EQUAL, ¬_inf, Assembler::kNearJump); |
+ // Check the high word. |
+ __ movl(EBX, FieldAddress(EAX, Double::value_offset() + kWordSize)); |
+ // Mask off sign bit. |
+ __ andl(EBX, Immediate(0x7FFFFFFF)); |
+ // Compare with +infinity. |
+ __ cmpl(EBX, Immediate(0x7FF00000)); |
+ __ j(NOT_EQUAL, ¬_inf, Assembler::kNearJump); |
+ __ LoadObject(EAX, Bool::True()); |
+ __ ret(); |
+ |
+ __ Bind(¬_inf); |
+ __ LoadObject(EAX, Bool::False()); |
+ __ ret(); |
+} |
+ |
+ |
void Intrinsifier::Double_getIsNegative(Assembler* assembler) { |
Label is_false, is_true, is_zero; |
__ movl(EAX, Address(ESP, +1 * kWordSize)); |