-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix immediate value field for addis and lis instruction on Power #9612
Comments
One of the edge cases is trying to add An example of code that might be generated is:
Note how the top half This causes a problem because |
addis and lis accept a signed 16 bit value as an immediate. They are passed into generateTrg1Src1ImmInstruction as signed 32 bit values. In some edge cases, the sign extension was not handled properly. In most cases this was due to the value being incremented after sign extension. In other cases it was due to an unnecessary mask clearing the upper 16 bits. One case in genInstanceOfOrCheckCastSuperClassTest was handled incorrectly. addis should be used instead of lis to reconstruct the 32 bit immediate value to be added. For cases where the TOC offset is unusually large, I put in an assert instead of generating instructions. The reasoning was TOC offsets of this size should never occur so those code paths would never be tested. Also TOC offsets of that size are likely an indication of a problem elsewhere. Closes: eclipse-openj9#9612 Signed-off-by: jimmyk <jimmyk@ca.ibm.com>
addis and lis accept a signed 16 bit value as an immediate. They are passed into generateTrg1Src1ImmInstruction as signed 32 bit values. In some edge cases, the sign extension was not handled properly. In most cases this was due to the value being incremented after sign extension. In other cases it was due to an unnecessary mask clearing the upper 16 bits. One case in genInstanceOfOrCheckCastSuperClassTest was handled incorrectly. addis should be used instead of lis to reconstruct the 32 bit immediate value to be added. For cases where the TOC offset is unusually large, I put in an assert instead of generating instructions. The reasoning was TOC offsets of this size should never occur so those code paths would never be tested. Also TOC offsets of that size are likely an indication of a problem elsewhere. Closes: eclipse-openj9#9612 Signed-off-by: jimmyk <jimmyk@ca.ibm.com>
addis and lis accept a signed 16 bit value as an immediate. They are passed into generateTrg1Src1ImmInstruction as signed 32 bit values. In some edge cases, the sign extension was not handled properly. In most cases this was due to the value being incremented after sign extension. In other cases it was due to an unnecessary mask clearing the upper 16 bits. One case in genInstanceOfOrCheckCastSuperClassTest was handled incorrectly. addis should be used instead of lis to reconstruct the 32 bit immediate value to be added. For cases where the TOC offset is unusually large, I put in an assert instead of generating instructions. The reasoning was TOC offsets of this size should never occur so those code paths would never be tested. Also TOC offsets of that size are likely an indication of a problem elsewhere. Closes: eclipse-openj9#9612 Signed-off-by: jimmyk <jimmyk@ca.ibm.com>
addis
andlis
accept a signed 16 bit value as an immediate value. They are passed intogenerateTrg1Src1ImmInstruction
orgenerateTrg1ImmInstruction
as signed 32 bit values. In some edge cases, the sign extension is not handled properly. In most cases this is due to the value being incremented after sign extension. In other cases it was due to an unnecessary mask clearing the upper 16 bits.One case in
genInstanceOfOrCheckCastSuperClassTest
was generating the wrong instruction.addis
should be used instead oflis
to reconstruct the 32 bit immediate value to be added.The text was updated successfully, but these errors were encountered: