Closed Bug 595728 Opened 14 years ago Closed 14 years ago

nanojit: clarify semantics of shift operations

Categories

(Core Graveyard :: Nanojit, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: n.nethercote, Assigned: n.nethercote)

Details

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

Attachments

(1 file)

LIR's shift operations follow x86 semantics, ie. the low 5 bits of the shift value are used (and treated as unsigned), the others are ignored.  This should be documented in LIRopcode.tbl and tested in some lirasm tests.
This patch:

- Documents in LIRopcode.tbl the behaviour of the second operand of
  lshi/rshi/rshui/lshq/rshq/rshuq.

- Adds tests shi.in and shq.in to test the behaviour.

- Augments lirasm to handle quad return types, and renames some related
  identifiers to use the new(ish) type names "int", "quad" and "double".

- Runs the randomized LIR tests last because they are slow.

The MIPS, ARM, and PPC back-ends all do the necessary masking.  Sparc
doesn't and I don't know if Sparc hardware does that or not.  Ginn, do you
know?
Attachment #474590 - Flags: review?(edwsmith)
Comment on attachment 474590 [details] [diff] [review]
patch (against TM 53416:65a532c7885e)

Nice
Attachment #474590 - Flags: review?(edwsmith) → review+
http://hg.mozilla.org/tamarin-redux/rev/0ea3d10f0d3f
Whiteboard: fixed-in-nanojit → fixed-in-nanojit,fixed-in-tamarin
http://hg.mozilla.org/tracemonkey/rev/5b635104824f
Whiteboard: fixed-in-nanojit,fixed-in-tamarin → fixed-in-nanojit, fixed-in-tamarin, fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/5b635104824f
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Is it related to the previous Bug 577449 ? (not yet applied)
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.