Closed Bug 894781 Opened 12 years ago Closed 12 years ago

OdinMonkey: Incorrect float abs

Categories

(Core :: JavaScript Engine, defect)

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: jruderman, Assigned: bbouvier)

References

Details

(Keywords: regression, testcase)

Attachments

(1 file)

function m(stdlib) { "use asm"; var abs = stdlib.Math.abs; function f(d) { d = +d; return (~~(5.0 - +abs(d)))|0; } return f; } var f = m(this); assertEq(f(0.2), 4); // got 5, expected 4 assertEq(f(NaN), 0); // got 5, expected 0 The first bad revision is: changeset: http://hg.mozilla.org/mozilla-central/rev/21154eef33ac user: Benjamin Bouvier date: Mon Jul 15 14:46:03 2013 -0700 summary: Bug 893368: in asm.js, correctly compute range for truncated Math.abs calls; r=nbp
The only reason why this patch might be the cause is that there is another bug which set MAbs' implicitTruncate_ flag in such case.
Attached patch fix + test caseSplinter Review
We definitely don't want to truncate double values. Luke, what do you think of putting all range analysis test cases in a single testRangeAnalysis file? It would avoid test files proliferation in tests/asm.js.
Assignee: general → bbouvier
Status: NEW → ASSIGNED
Attachment #777251 - Flags: review?(luke)
Comment on attachment 777251 [details] [diff] [review] fix + test case Looks good and testRangeAnalysis also sounds good.
Attachment #777251 - Flags: review?(luke) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: