Skip to content
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

Use 32-bit XORRegReg to zero registers on x64 #19236

Closed
0xdaryl opened this issue Mar 27, 2024 · 0 comments · Fixed by #19320
Closed

Use 32-bit XORRegReg to zero registers on x64 #19236

0xdaryl opened this issue Mar 27, 2024 · 0 comments · Fixed by #19320

Comments

@0xdaryl
Copy link
Contributor

0xdaryl commented Mar 27, 2024

When XORRegReg is used to zero a register on x64, the 32-bit operand form should be used because the upper 32-bits of the result are automatically zero extended. This will save a REX prefix on each of these instructions (1 byte savings).

Sweep through the x86 code generator looking at where XORRegReg or XOR8RegReg is used for the purpose of zeroing a register and ensure it uses XOR4RegReg instead. I found a few on inspection.

OpenJ9 companion issue to eclipse/omr#7295

R2steven pushed a commit to R2steven/openj9 that referenced this issue Apr 5, 2024
Swept through x86 codegen and replaced XORRegReg with XOR4RegReg when used to zero a register

Closes eclipse-openj9#19236
Signed-off-by: Ryan Stevens <restevens52+eclipse@gmail.com>
R2steven added a commit to R2steven/openj9 that referenced this issue Apr 12, 2024
Swept through x86 codegen and replaced XORRegReg with XOR4RegReg when used to zero a register

Closes eclipse-openj9#19236
Signed-off-by: Ryan Stevens <restevens52@gmail.com>
R2steven added a commit to R2steven/openj9 that referenced this issue Apr 25, 2024
converted XORRegReg() to XOR4RegReg in AMD64JNILinkage.cpp

closes eclipse-openj9#19236
Sighed-off-by: Ryan Stevens restevens52@gmail.com
R2steven added a commit to R2steven/openj9 that referenced this issue May 6, 2024
Swept through x86 codegen and replaced XORRegReg with XOR4RegReg when used to zero a register

Closes eclipse-openj9#19236
Signed-off-by: Ryan Stevens <restevens52@gmail.com>
R2steven added a commit to R2steven/openj9 that referenced this issue May 6, 2024
Swept through x86 codegen and replaced XORRegReg with XOR4RegReg when used to zero a register

Closes eclipse-openj9#19236
Signed-off-by: Ryan Stevens <restevens52@gmail.com>
R2steven added a commit to R2steven/openj9 that referenced this issue May 6, 2024
Swept through x86 codegen and replaced XORRegReg with XOR4RegReg when used to zero a register

Closes eclipse-openj9#19236
Signed-off-by: Ryan Stevens <restevens52@gmail.com>

Fix missing cases in AMD64JNILinkage

converted XORRegReg() to XOR4RegReg in AMD64JNILinkage.cpp

closes eclipse-openj9#19236
Signed-off-by: Ryan Stevens <restevens52@gmail.com>
R2steven added a commit to R2steven/openj9 that referenced this issue May 6, 2024
Swept through x86 codegen and replaced XORRegReg with XOR4RegReg when used to zero a register

Fix missing cases in AMD64JNILinkage
converted XORRegReg() to XOR4RegReg in AMD64JNILinkage.cpp

closes eclipse-openj9#19236
Signed-off-by: Ryan Stevens <restevens52@gmail.com>
AswathySK pushed a commit to AswathySK/openj9 that referenced this issue Jun 4, 2024
Swept through x86 codegen and replaced XORRegReg with XOR4RegReg when used to zero a register

Fix missing cases in AMD64JNILinkage
converted XORRegReg() to XOR4RegReg in AMD64JNILinkage.cpp

closes eclipse-openj9#19236
Signed-off-by: Ryan Stevens <restevens52@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant