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

Unified Diff: test/mjsunit/asm/uint32div.js

Issue 701813003: [turbofan] Fix recognition of Uint32Div in simplified lowering. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/uint32div.js
diff --git a/test/mjsunit/asm/uint32div.js b/test/mjsunit/asm/uint32div.js
index 54a2138786692ebf24e7e3e7d21cda2879e39952..dcbb73bfa9e45e16dbd9c8accf8de10e8b1193c4 100644
--- a/test/mjsunit/asm/uint32div.js
+++ b/test/mjsunit/asm/uint32div.js
@@ -22,8 +22,24 @@ function Uint32Div(divisor) {
var divisors = [0, 1, 3, 4, 10, 42, 64, 100, 1024, 2147483647, 4294967295];
for (var i in divisors) {
var divisor = divisors[i];
- var mod = Uint32Div(divisor);
+ var div = Uint32Div(divisor);
for (var dividend = 0; dividend < 4294967296; dividend += 3999773) {
- assertEquals((dividend / divisor) >>> 0, mod(dividend));
+ assertEquals((dividend / divisor) >>> 0, div(dividend));
+ }
+}
+
+var div = (function(stdlib, foreign, heap) {
+ "use asm";
+ function div(dividend, divisor) {
+ return (dividend >>> 0) / (divisor >>> 0) | 0;
+ }
+ return {div: div};
+})(stdlib, foreign, heap).div;
+
+for (var i in divisors) {
+ var divisor = divisors[i];
+ for (var dividend = 0; dividend < 4294967296; dividend += 3999773) {
+ assertEquals((dividend >>> 0) / (divisor >>> 0) | 0,
+ div(dividend, divisor));
}
}
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698