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

Unified Diff: tests/language/arithmetic_test.dart

Issue 92433002: Merge sin(a), cos(a) into one instruction. TODO: Implement for ARM and MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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: tests/language/arithmetic_test.dart
===================================================================
--- tests/language/arithmetic_test.dart (revision 30802)
+++ tests/language/arithmetic_test.dart (working copy)
@@ -432,6 +432,15 @@
var b = -1;
for (var i = 0; i < 10; i++) Expect.equals(0x40000000, divMod(a, b));
}
+
+ static double sinCosSub(double a) => sin(a) - cos(a);
+
+ static void testSinCos() {
Florian Schneider 2013/12/03 14:12:04 Maybe test a few more values like PI, PI/2 as done
srdjan 2013/12/03 18:10:01 Done.
+ var e = sin(1.234) - cos(1.234);
+ for (var i = 0; i < 20; i++) {
+ Expect.approxEquals(e, sinCosSub(1.234));
+ }
+ }
static mySqrt(var x) => sqrt(x);
@@ -460,6 +469,7 @@
testSmiDivModDeopt();
testSqrtDeopt();
testDoubleEquality();
+ testSinCos();
}
}
}
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698