Closed Bug 529846 Opened 10 years ago Closed 10 years ago

check-3d-raytrace.js failed on Solaris x86

Categories

(Core :: JavaScript Engine, defect)

x86
Solaris
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: ginnchen+exoracle, Assigned: ginnchen+exoracle)

Details

Attachments

(1 file)

Expected ....[0,0.29329773299429385,0] ....
Got ....[0,0.2932977329942938,0] ....

It is fine on SPARC.
It is a rounding problem with sqrt().

On Solaris x86, when it does fsqrt, the control word is 0x137f. Means double extended precision (64bits) and rounding to nearest.
On Linux x86, the control word was 0x037f at startup, but it changed to 0x027f at some point. Means double precision (53bits) and rounding to nearest.

Add -fprecision=double to CXXFLAGS will solve the problem, but I don't understand what's the trick for gcc/Linux.
Ah, I found it, FIX_FPU().
Attached patch patchSplinter Review
Match the behavior of FIX_FPU() as on other x86 platforms.
Do the same thing for js_DoubleToECMAInt32, StringMatch.
Assignee: general → ginn.chen
Status: NEW → ASSIGNED
Attachment #424756 - Flags: review?(brendan)
Attachment #424756 - Flags: review?(brendan) → review?(jim)
Hi, Ginn.  Taking a look at this and the other two, now.
Attachment #424756 - Flags: review?(jim) → review+
http://hg.mozilla.org/mozilla-central/rev/c5613c851054
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.