Closed
Bug 983448
Opened 11 years ago
Closed 11 years ago
masm.convertUInt32ToFloat32 gives wrong results on x86
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: luke, Assigned: luke)
References
Details
Attachments
(1 file)
2.94 KB,
patch
|
bbouvier
:
review+
Sylvestre
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
convertUInt32ToFloat32 uses the same scheme as convertUInt32ToDouble (subtract 2^31, cvtsi2sd, add 2^31), except that this doesn't work for float because float can't precisely represent integers as large as 2^31 so the final addition ends up producing the wrong number for small integers. (Atm, convertUint3ToFloat32 is only generated from MAsmJSUnsignedToFloat32 so this is an asm.js-only bug.)
The C++ compiler does various arcane things for unsigned-to-float conversion but, seeing as this is a fairly rare operation, I just went with
convertUint32ToDouble
convertDoubleToFloat32
in this patch.
Attachment #8390885 -
Flags: review?(benj)
Comment 1•11 years ago
|
||
Comment on attachment 8390885 [details] [diff] [review]
fix-unsigned-to-float32
Review of attachment 8390885 [details] [diff] [review]:
-----------------------------------------------------------------
Doh, nice catch!
Attachment #8390885 -
Flags: review?(benj) → review+
![]() |
Assignee | |
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
Assignee: nobody → luke
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
![]() |
Assignee | |
Comment 4•11 years ago
|
||
Comment on attachment 8390885 [details] [diff] [review]
fix-unsigned-to-float32
[Approval Request Comment]
Bug caused by (feature/regressing bug #): 904918
User impact if declined: incorrect JS results
Testing completed (on m-c, etc.): m-c, m-a
Risk to taking this patch (and alternatives if risky): very low
Attachment #8390885 -
Flags: approval-mozilla-beta?
Updated•11 years ago
|
Attachment #8390885 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 5•11 years ago
|
||
status-firefox29:
--- → fixed
status-firefox30:
--- → fixed
Comment 6•11 years ago
|
||
Flags: in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•