Closed Bug 560106 Opened 11 years ago Closed 11 years ago

Add missing 64-bit algebraic optimizations to ExprFilter

Categories

(Core Graveyard :: Nanojit, defect, P2)

x86_64
All
defect

Tracking

(Not tracked)

RESOLVED FIXED
flash10.2

People

(Reporter: edwsmith, Assigned: edwsmith)

References

Details

(Whiteboard: PACMAN, fixed-in-nanojit, fixed-in-tracemonkey, fixed-in-tamarin)

Attachments

(1 file, 3 obsolete files)

Several 32-bit optimizations in ExprFilter are missing their 64-bit couterparts:

* constant folding
* algebraic simplifications for op(x, imm64)
Target Milestone: --- → Future
Assignee: nobody → edwsmith
Status: NEW → ASSIGNED
Handle more cases.  Now each 32-bit optimization in ExprFilter::ins2() should have a 64-bit counterpart.
Attachment #439771 - Attachment is obsolete: true
Whiteboard: PACMAN
Priority: -- → P2
Target Milestone: Future → flash10.2
Attachment #439891 - Attachment is obsolete: true
Attachment #446973 - Flags: review?(gal)
Comment on attachment 446973 [details] [diff] [review]
constant folding for LIR_i2q and ui2uq

immI() already returns int32_t but a bit overcasting for clarity can't hurt and it matches the uint case where its needed.
Attachment #446973 - Flags: review?(gal) → review+
yup, i'm counting on sign extension, thats why I overcasted for clarity.
Comment on attachment 446973 [details] [diff] [review]
constant folding for LIR_i2q and ui2uq

NJ: i2q constant folding
http://hg.mozilla.org/projects/nanojit-central/rev/e6ce59a07d5f
Comment on attachment 446880 [details] [diff] [review]
(v3) Adds ALU op constant folding and algebraic simplifications

On line 619, insImmI(0) is returned in all cases.  Should be insImmQ(0) for LIR_xorq.

R+ with the above fix.

nits: I would prefer redundant explicit casts on unsigned shift arguments in the 64-bit case similar to those on signed arguments in the 32-bit case.  The fact that immI() returns int32_t and immQ() returns uint64_t is confusing.  Also, inside an #ifdef NANOJIT_64BIT, InsImmWord can be replaced with InsImmQ.
Attachment #446880 - Flags: review?(wmaddox) → review+
Attachment #446973 - Attachment is obsolete: true
I'll update this once Bug 527512 lands, since it cleans up code.  I could also wait for bug 569753 (splitting up ExprFilter::ins2) to avoid making the problem worse before it gets better.  opinions?
Blocks: 569753
Depends on: 527512
http://hg.mozilla.org/tracemonkey/rev/04f69ec5483b
Whiteboard: PACMAN → PACMAN, fixed-in-nanojit, fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/04f69ec5483b
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: PACMAN, fixed-in-nanojit, fixed-in-tracemonkey → PACMAN, fixed-in-nanojit, fixed-in-tracemonkey, fixed-in-tamarin
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.