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

Unified Diff: runtime/vm/assembler_ia32_test.cc

Issue 9320023: Intrinisifed more core library methods: isNaN, isNegative, cos, sin. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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/assembler_ia32.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32_test.cc
===================================================================
--- runtime/vm/assembler_ia32_test.cc (revision 3859)
+++ runtime/vm/assembler_ia32_test.cc (working copy)
@@ -968,6 +968,19 @@
}
+ASSEMBLER_TEST_GENERATE(IntToDoubleConversion2, assembler) {
+ __ filds(Address(ESP, kWordSize));
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(IntToDoubleConversion2, entry) {
+ typedef double (*IntToDoubleConversion2Code)(int i);
+ double res = reinterpret_cast<IntToDoubleConversion2Code>(entry)(3);
+ EXPECT_FLOAT_EQ(3.0, res, 0.001);
+}
+
+
ASSEMBLER_TEST_GENERATE(IntToFloatConversion, assembler) {
__ movl(EDX, Immediate(6));
__ cvtsi2ss(XMM1, EDX);
@@ -1653,6 +1666,24 @@
}
+ASSEMBLER_TEST_GENERATE(ExtractSignBits, assembler) {
+ __ movsd(XMM0, Address(ESP, kWordSize));
+ __ movmskpd(EAX, XMM0);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(ExtractSignBits, entry) {
+ typedef int (*ExtractSignBits)(double d);
+ int res = reinterpret_cast<ExtractSignBits>(entry)(1.0);
+ EXPECT_EQ(0, res);
+ res = reinterpret_cast<ExtractSignBits>(entry)(-1.0);
+ EXPECT_EQ(1, res);
+ res = reinterpret_cast<ExtractSignBits>(entry)(-0.0);
+ EXPECT_EQ(1, res);
+}
+
+
// Return -1 if signed, 1 if not signed and 0 otherwise.
ASSEMBLER_TEST_GENERATE(ConditionalMovesSign, assembler) {
// Preserve clobbered callee-saved register (EBX).
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698