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

Unified Diff: test/mjsunit/smi-ops.js

Issue 509001: Bring back the fisttp instruction on machines with SSE3, but check the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/smi-ops.js
===================================================================
--- test/mjsunit/smi-ops.js (revision 3492)
+++ test/mjsunit/smi-ops.js (working copy)
@@ -537,7 +537,7 @@
one = four - three;
zero = one - one;
- // Begin block A repeat 3
+ // Begin block A repeat 3
assertEquals(pos_non_smi, (pos_non_smi) >> zero);
assertEquals(pos_non_smi, (pos_non_smi) >>> zero);
assertEquals(pos_non_smi, (pos_non_smi) << zero);
@@ -638,7 +638,32 @@
testShiftNonSmis();
+function intConversion() {
+ function foo(x) {
+ assertEquals(x, (x * 1.0000000001) | 0, "foo more " + x);
+ assertEquals(x, x | 0, "foo " + x);
+ if (x > 0) {
+ assertEquals(x - 1, (x * 0.9999999999) | 0, "foo less " + x);
+ } else {
+ assertEquals(x + 1, (x * 0.9999999999) | 0, "foo less " + x);
+ }
+ }
+ for (var i = 1; i < 0x80000000; i *= 2) {
+ foo(i);
+ foo(-i);
+ }
+ for (var i = 1; i < 1/0; i *= 2) {
+ assertEquals(i | 0, (i * 1.0000000000000001) | 0, "b" + i);
+ assertEquals(-i | 0, (i * -1.0000000000000001) | 0, "c" + i);
+ }
+ for (var i = 0.5; i > 0; i /= 2) {
+ assertEquals(0, i | 0, "d" + i);
+ assertEquals(0, -i | 0, "e" + i);
+ }
+}
+intConversion();
+
// Verify that we handle the (optimized) corner case of shifting by
// zero even for non-smis.
function shiftByZero(n) { return n << 0; }
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698