Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: runtime/vm/intrinsifier_ia32.cc

Issue 2433813002: Reland "Add DoubleTestOp instruction" (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, &not_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, &not_inf, Assembler::kNearJump);
+ __ LoadObject(EAX, Bool::True());
+ __ ret();
+
+ __ Bind(&not_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));
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698