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

Unified Diff: runtime/vm/assembler_x64_test.cc

Issue 10542167: Inline Math.sqrt in new compilers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
Index: runtime/vm/assembler_x64_test.cc
===================================================================
--- runtime/vm/assembler_x64_test.cc (revision 8696)
+++ runtime/vm/assembler_x64_test.cc (working copy)
@@ -1277,9 +1277,10 @@
ASSEMBLER_TEST_GENERATE(XorpdZeroing, assembler) {
- __ movsd(XMM0, Address(RSP, kWordSize));
- __ xorpd(XMM0, Address(RSP, kWordSize));
- __ movq(RAX, Immediate(999));
+ __ pushq(RAX);
+ __ movsd(Address(RSP, 0), XMM0);
+ __ xorpd(XMM0, Address(RSP, 0));
+ __ popq(RAX);
__ ret();
}
@@ -1290,6 +1291,20 @@
EXPECT_FLOAT_EQ(0.0, res, 0.0001);
}
+
+ASSEMBLER_TEST_GENERATE(SquareRootDouble, assembler) {
+ __ sqrtsd(XMM0, XMM0);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(SquareRootDouble, entry) {
+ typedef double (*SquareRootDoubleCode)(double d);
+ const double kDoubleConst = .7;
+ double res = reinterpret_cast<SquareRootDoubleCode>(entry)(kDoubleConst);
+ EXPECT_FLOAT_EQ(sqrt(kDoubleConst), res, 0.0001);
+}
+
} // namespace dart
#endif // defined TARGET_ARCH_X64

Powered by Google App Engine
This is Rietveld 408576698