OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function Module(stdlib, foreign, heap) { | 5 function Module(stdlib, foreign, heap) { |
6 'use asm'; | 6 'use asm'; |
7 | 7 |
8 function foo1(i1) { | 8 function foo1(i1) { |
9 i1 = i1 | 0; | 9 i1 = i1 | 0; |
10 var i10 = i1 >> 5; | 10 var i10 = 0; |
| 11 i10 = (i1 >> 5) | 0; |
11 if (i10 >>> 0 < 5) { | 12 if (i10 >>> 0 < 5) { |
12 return 1; | 13 return 1; |
13 } else { | 14 } else { |
14 return 0; | 15 return 0; |
15 } | 16 } |
16 return 0; | 17 return 0; |
17 } | 18 } |
18 | 19 |
19 function foo2(i1) { | 20 function foo2(i1) { |
20 i1 = i1 | 0; | 21 i1 = i1 | 0; |
21 var i10 = i1 / 32 | 0; | 22 var i10 = 0; |
| 23 i10 = ((i1 | 0) / 32) | 0; |
22 if (i10 >>> 0 < 5) { | 24 if (i10 >>> 0 < 5) { |
23 return 1; | 25 return 1; |
24 } else { | 26 } else { |
25 return 0; | 27 return 0; |
26 } | 28 } |
27 return 0; | 29 return 0; |
28 } | 30 } |
29 | 31 |
30 function foo3(i1) { | 32 function foo3(i1) { |
31 i1 = i1 | 0; | 33 i1 = i1 | 0; |
32 var i10 = (i1 + 32 | 0) / 32 | 0; | 34 var i10 = 0; |
| 35 i10 = (i1 + 32 | 0) / 32 | 0; |
33 if (i10 >>> 0 < 5) { | 36 if (i10 >>> 0 < 5) { |
34 return 1; | 37 return 1; |
35 } else { | 38 } else { |
36 return 0; | 39 return 0; |
37 } | 40 } |
38 return 0; | 41 return 0; |
39 } | 42 } |
40 return {foo1: foo1, foo2: foo2, foo3: foo3}; | 43 return {foo1: foo1, foo2: foo2, foo3: foo3}; |
41 } | 44 } |
42 | 45 |
43 var m = Module(this, {}, undefined); | 46 var m = Module(this, {}, undefined); |
44 | 47 |
45 for (var i = 0; i < 4 * 32; i++) { | 48 for (var i = 0; i < 4 * 32; i++) { |
46 assertEquals(1, m.foo1(i)); | 49 assertEquals(1, m.foo1(i)); |
47 assertEquals(1, m.foo2(i)); | 50 assertEquals(1, m.foo2(i)); |
48 assertEquals(1, m.foo3(i)); | 51 assertEquals(1, m.foo3(i)); |
49 } | 52 } |
50 | 53 |
51 for (var i = 4 * 32; i < 5 * 32; i++) { | 54 for (var i = 4 * 32; i < 5 * 32; i++) { |
52 assertEquals(1, m.foo1(i)); | 55 assertEquals(1, m.foo1(i)); |
53 assertEquals(1, m.foo2(i)); | 56 assertEquals(1, m.foo2(i)); |
54 assertEquals(0, m.foo3(i)); | 57 assertEquals(0, m.foo3(i)); |
55 } | 58 } |
56 | 59 |
57 for (var i = 5 * 32; i < 10 * 32; i++) { | 60 for (var i = 5 * 32; i < 10 * 32; i++) { |
58 assertEquals(0, m.foo1(i)); | 61 assertEquals(0, m.foo1(i)); |
59 assertEquals(0, m.foo2(i)); | 62 assertEquals(0, m.foo2(i)); |
60 assertEquals(0, m.foo3(i)); | 63 assertEquals(0, m.foo3(i)); |
61 } | 64 } |
OLD | NEW |