RESOLVED FIXED 120020
Change Set 154207 causes wrong register to be used for 32 bit tests
https://bugs.webkit.org/show_bug.cgi?id=120020
Summary Change Set 154207 causes wrong register to be used for 32 bit tests
Michael Saboff
Reported 2013-08-19 12:29:55 PDT
The change to branchTest32(ResultCondition, RegisterID, TrustedImm32) in change set 154207 breaks the testing of registers esp, ebp, esi and edi. Due to the encoding of registers for 32bit addressing, registers numbered 4-7 (esp, ebp, esi and edi) become the upper half of registers 0-3 (ah, ch, dh and bh respectively). Therefore a call to branchTestPtr(Zero, GPRInfo::edi, TrustedImm32(7)) while emit a testb $7, %bh instruction. For 64 bit addressing, a REX prefix is used to assure the right lower 8 bits or a register are used.
Attachments
Patch (1.71 KB, patch)
2013-08-19 13:28 PDT, Michael Saboff
benjamin: review+
Michael Saboff
Comment 1 2013-08-19 13:28:58 PDT
Created attachment 209115 [details] Patch Limit the prior optimization to registers eax, ecx, edx and ebx per intel documentation.
Michael Saboff
Comment 2 2013-08-19 14:25:34 PDT
Note You need to log in before you can comment on or make changes to this bug.