Index: runtime/vm/intrinsifier_mips.cc |
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc |
index 748f06dff9d7bdda74aa590ac74a56fae2844ae1..ff354af7f4455fce5ca87bb738162f61e4f2b3ac 100644 |
--- a/runtime/vm/intrinsifier_mips.cc |
+++ b/runtime/vm/intrinsifier_mips.cc |
@@ -1530,6 +1530,27 @@ void Intrinsifier::Double_getIsNaN(Assembler* assembler) { |
} |
+void Intrinsifier::Double_getIsInfinite(Assembler* assembler) { |
+ Label not_inf; |
+ __ lw(T0, Address(SP, 0 * kWordSize)); |
+ __ lw(T1, FieldAddress(T0, Double::value_offset())); |
+ __ lw(T2, FieldAddress(T0, Double::value_offset() + kWordSize)); |
+ // If the low word isn't zero, then it isn't infinity. |
+ __ bne(T1, ZR, ¬_inf); |
+ // Mask off the sign bit. |
+ __ AndImmediate(T2, T2, 0x7FFFFFFF); |
+ // Compare with +infinity. |
+ __ BranchNotEqual(T2, Immediate(0x7FF00000), ¬_inf); |
+ |
+ __ LoadObject(V0, Bool::True()); |
+ __ Ret(); |
+ |
+ __ Bind(¬_inf); |
+ __ LoadObject(V0, Bool::False()); |
+ __ Ret(); |
+} |
+ |
+ |
void Intrinsifier::Double_getIsNegative(Assembler* assembler) { |
Label is_false, is_true, is_zero; |
__ lw(T0, Address(SP, 0 * kWordSize)); |