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

Side by Side Diff: test/mjsunit/regress/math-min.js

Issue 1695283002: [crankshaft][arm][mips] Fix Math.min(0, 0) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips64 too Created 4 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
« no previous file with comments | « src/crankshaft/mips64/lithium-codegen-mips64.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
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 var a = new Float64Array(4);
8 a[2] *= -1;
9 a[3] *= -1;
10 assertEquals(0, a[0]);
11 assertEquals(0, a[1]);
12 assertEquals(-0, a[2]);
13 assertEquals(-0, a[3]);
14
15 function f1() {
16 var z = a[0];
17 // Same register.
18 assertEquals(0, Math.min(z, z));
19 }
20
21 function f2() {
22 // Different registers.
23 assertEquals(0, Math.min(a[0], a[1]));
24 }
25
26 function f3() {
27 // Zero and minus zero.
28 assertEquals(-0, Math.min(a[1], a[2]));
29 }
30
31 function f4() {
32 // Zero and minus zero, reversed order.
33 assertEquals(-0, Math.min(a[2], a[1]));
34 }
35
36 function f5() {
37 // Minus zero, same register.
38 var m_z = a[2];
39 assertEquals(-0, Math.min(m_z, m_z));
40 }
41
42 function f6() {
43 // Minus zero, different registers.
44 assertEquals(-0, Math.min(a[2], a[3]));
45 }
46
47 for (var i = 0; i < 3; i++) {
48 f1();
49 f2();
50 f3();
51 f4();
52 f5();
53 f6();
54 }
55 %OptimizeFunctionOnNextCall(f1);
56 %OptimizeFunctionOnNextCall(f2);
57 %OptimizeFunctionOnNextCall(f3);
58 %OptimizeFunctionOnNextCall(f4);
59 %OptimizeFunctionOnNextCall(f5);
60 %OptimizeFunctionOnNextCall(f6);
61 f1();
62 f2();
63 f3();
64 f4();
65 f5();
66 f6();
OLDNEW
« no previous file with comments | « src/crankshaft/mips64/lithium-codegen-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698