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

Unified Diff: runtime/vm/assembler_ia32_test.cc

Issue 562203005: Inline toDouble calls on mints (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32_test.cc
diff --git a/runtime/vm/assembler_ia32_test.cc b/runtime/vm/assembler_ia32_test.cc
index 1d17e4c80b20bae36a1c0094d3a1e84be8ab5014..75fd31c29efa5e44754fe57aecd36db12c846a8d 100644
--- a/runtime/vm/assembler_ia32_test.cc
+++ b/runtime/vm/assembler_ia32_test.cc
@@ -2048,6 +2048,45 @@ ASSEMBLER_TEST_RUN(IntToDoubleConversion2, test) {
}
+ASSEMBLER_TEST_GENERATE(Int64ToDoubleConversion, assembler) {
+ __ movl(EAX, Immediate(0));
+ __ movl(EDX, Immediate(6));
+ __ pushl(EAX);
+ __ pushl(EDX);
+ __ fildl(Address(ESP, 0));
+ __ popl(EAX);
+ __ popl(EAX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(Int64ToDoubleConversion, test) {
+ typedef double (*Int64ToDoubleConversionCode)();
+ double res = reinterpret_cast<Int64ToDoubleConversionCode>(test->entry())();
+ EXPECT_FLOAT_EQ(6.0, res, 0.001);
Florian Schneider 2014/09/17 11:15:32 I think can be 6.0 represented exactly. No need fo
Cutch 2014/09/18 16:39:48 Done.
+}
+
+
+ASSEMBLER_TEST_GENERATE(NegativeInt64ToDoubleConversion, assembler) {
+ __ movl(EAX, Immediate(0xFFFFFFFF));
+ __ movl(EDX, Immediate(0xFFFFFFFA));
+ __ pushl(EAX);
+ __ pushl(EDX);
+ __ fildl(Address(ESP, 0));
+ __ popl(EAX);
+ __ popl(EAX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(NegativeInt64ToDoubleConversion, test) {
+ typedef double (*NegativeInt64ToDoubleConversionCode)();
+ double res =
+ reinterpret_cast<NegativeInt64ToDoubleConversionCode>(test->entry())();
+ EXPECT_FLOAT_EQ(-6.0, res, 0.001);
Florian Schneider 2014/09/17 11:15:32 I think can be -6.0 represented exactly. No need f
Cutch 2014/09/18 16:39:48 Done.
+}
+
+
ASSEMBLER_TEST_GENERATE(IntToFloatConversion, assembler) {
__ movl(EDX, Immediate(6));
__ cvtsi2ss(XMM1, EDX);
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698