Closed
Bug 517405
Opened 15 years ago
Closed 15 years ago
nanojit: don't compute x86 FP conditions twice(!)
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
(Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey)
Attachments
(1 file)
739 bytes,
patch
|
rreitmai
:
review+
|
Details | Diff | Splinter Review |
asm_fcond() computes the condition twice. Yes, you read that right. Here's example code: flt2 = flt fdiv1, js_BooleanOrUndefinedToNumber2 ucomisd xmm0,xmm1 lahf test ah, 5 setnp eax movzx eax,eax ucomisd xmm1,xmm0 seta eax movzx eax,eax The first five instructions compute it (badly), then the last three recompute it (better). I don't know how this got past quality control, but simply chopping out a few lines in Nativei386.cpp results in the first five instructions being avoided. Amusingly, the Sparc back-end is heavily based on the x86 back-end but it doesn't make this mistake. It doesn't speed up SunSpider, unfortunately, presumably because asm_fcond() doesn't occur very often (most comparisons are handled within asm_. In fact I'm getting a 6ms slow-down but that clearly must be noise.
Attachment #401382 -
Flags: review?(rreitmai)
Updated•15 years ago
|
Attachment #401382 -
Flags: review?(rreitmai) → review+
Comment 1•15 years ago
|
||
Comment on attachment 401382 [details] [diff] [review] patch Good catch; maybe old cut&paste bug?
Assignee | ||
Comment 2•15 years ago
|
||
http://hg.mozilla.org/projects/nanojit-central/rev/bb0d40d10977
Whiteboard: fixed-in-nanojit
Comment 3•15 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/04014b568209
Whiteboard: fixed-in-nanojit → fixed-in-nanojit, fixed-in-tracemonkey
Comment 4•15 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/04014b568209
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•