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

Side by Side Diff: test/mjsunit/div-mod.js

Issue 597059: Added optimization for div/mod by constant power of 2. (Closed)
Patch Set: Moved div code, removed mod code, only div by 2. Created 10 years, 10 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 unified diff | Download patch
« src/ia32/codegen-ia32.cc ('K') | « src/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 for (var i = 0; i < example_numbers.length; i++) { 147 for (var i = 0; i < example_numbers.length; i++) {
148 for (var j = 0; j < example_numbers.length; j++) { 148 for (var j = 0; j < example_numbers.length; j++) {
149 var a = example_numbers[i]; 149 var a = example_numbers[i];
150 var b = example_numbers[j]; 150 var b = example_numbers[j];
151 doTest(a,b); 151 doTest(a,b);
152 doTest(-a,b); 152 doTest(-a,b);
153 doTest(a,-b); 153 doTest(a,-b);
154 doTest(-a,-b); 154 doTest(-a,-b);
155 } 155 }
156 } 156 }
157 })() 157 })();
158
159
160 (function () {
161 // Edge cases
162 var zero = 0;
163 var minsmi32 = -0x40000000;
164 var minsmi64 = -0x80000000;
165 var somenum = 3532;
166 assertEquals(-0, zero / -1, "0 / -1");
167 assertEquals(1, minsmi32 / -0x40000000, "minsmi/minsmi-32");
168 assertEquals(1, minsmi64 / -0x80000000, "minsmi/minsmi-64");
169 assertEquals(somenum, somenum % -0x40000000, "%minsmi-32");
170 assertEquals(somenum, somenum % -0x80000000, "%minsmi-64");
171 })();
OLDNEW
« src/ia32/codegen-ia32.cc ('K') | « src/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698