Closed Bug 590212 Opened 15 years ago Closed 15 years ago

MIPS jmp instruction corruption

Categories

(Tamarin Graveyard :: Baseline JIT (CodegenLIR), defect)

Other
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: chris, Assigned: wmaddox)

Details

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

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/9.10 (karmic) Firefox/3.6.8 Build Identifier: An incorrect mask can cause invalid jmp instructions to be emitted dependent on the target address Reproducible: Sometimes
Could you explain exactly what the patch is fixing? Most of it looks like simply a stylistic cleanup (good though!). The substantive change appears to be forcing the shift to be logical (unsigned) in the JAL case. Is there anything more I am missing?
Assignee: nobody → wmaddox
The hardwired mask was 0x3fffffff instead of 0x03ffffff so some bits of a large address were leaking into the opcode field. The mask used in JINDEX was correct and should have been used for all of the j/jal variants.
Ah, so indeed the mask was too wide, and you now are masking a 26-bit field as required. In the case that you would have overflowed into the opcode previously, however, it now looks like you are just truncating the high bits (e.g., in excess of 28) of the original address 'dest'. I'm not clear on how this is supposed to work. Or was it always guaranteed that the address was in range, and you were just picking up spurious high-order bits by doing an arithmetic rather than a logical shift? Also, is there any reason why the JINDEX isn't simply folded into J_FORMAT?
(In reply to comment #4) > Ah, so indeed the mask was too wide, and you now are masking a 26-bit field as > required. In the case that you would have overflowed into the opcode > previously, however, it now looks like you are just truncating the high bits > (e.g., in excess of 28) of the original address 'dest'. I'm not clear on how > this is supposed to work. Hi, Chris. Was just looking at some MIPS docs. I missed that the high bits of the address were filled in from the PC. False alarm. If you want to make any more changes, let me know, I'll be happy to grant a review and push this.
Attachment #468717 - Flags: review+
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Whiteboard: fixed-in-nanojit
Hardware: All → Other
Whiteboard: fixed-in-nanojit → fixed-in-nanojit,fixed-in-tamarin
Whiteboard: fixed-in-nanojit,fixed-in-tamarin → fixed-in-nanojit, fixed-in-tamarin, fixed-in-tracemonkey
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.

Attachment

General

Creator:
Created:
Updated:
Size: