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
Improve rotate then insert selected bits on Z #3212
Comments
I just took a quick look. The This is only possible if the second child of the omr/compiler/z/codegen/BinaryEvaluator.cpp Lines 2457 to 2467 in 39bd590
Where I think we should be capturing this new opportunity is inside omr/compiler/z/codegen/BinaryEvaluator.cpp Lines 1644 to 1669 in 39bd590
Where if the |
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
I realized the solution proposed above will only work if the value we want to shift (Eg: 4 in the above example) is less than 256, as the |
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Not quite, the |
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Add a similar case for LSHL->LAND pattern Add a similar case for the unsigned variants of the instruction(LUSHR and LUSHL) Rename tryToReplaceLongAndWithRotateInstruction() to 'tryToReplaceShiftLandWithRotateInstruction() Allocate target register properly in tryToReplaceShiftLandWithRotateInstruction() Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Add a similar case for LSHL->LAND pattern Add a similar case for the unsigned variants of the instruction(LUSHR and LUSHL) Rename tryToReplaceLongAndWithRotateInstruction() to tryToReplaceShiftLandWithRotateInstruction() Allocate target register properly in tryToReplaceShiftLandWithRotateInstruction() Add respective Tril test for these changes Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca> a Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Add a similar case for LSHL->LAND pattern Add a similar case for the unsigned variants of the instruction(LUSHR and LUSHL) Rename tryToReplaceLongAndWithRotateInstruction() to tryToReplaceShiftLandWithRotateInstruction() Allocate target register properly in tryToReplaceShiftLandWithRotateInstruction() Add respective Tril test for these changes Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Add a similar case for LSHL->LAND pattern Add a similar case for the unsigned variants of the instruction(LUSHR and LUSHL) Rename tryToReplaceLongAndWithRotateInstruction() to tryToReplaceShiftLandWithRotateInstruction() Allocate target register properly in tryToReplaceShiftLandWithRotateInstruction() Add respective Tril test for these changes Remove LongAndRotateAsTest as those tests are now a strict subset of the added tests in ShiftAndRotateTest. Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Add a similar case for LSHL->LAND pattern Add a similar case for the unsigned variants of the instruction(LUSHR and LUSHL) Rename tryToReplaceLongAndWithRotateInstruction() to tryToReplaceShiftLandWithRotateInstruction() Allocate target register properly in tryToReplaceShiftLandWithRotateInstruction() Add respective Tril test for these changes Remove LongAndRotateAsTest as those tests are now a strict subset of the added tests in ShiftAndRotateTest. Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Add a similar case for LSHL->LAND pattern Add a similar case for the unsigned variants of the instruction(LUSHR and LUSHL) Rename tryToReplaceLongAndWithRotateInstruction() to tryToReplaceShiftLandWithRotateInstruction() Allocate target register properly in tryToReplaceShiftLandWithRotateInstruction() Add respective Tril test for these changes Remove LongAndRotateAsTest as those tests are now a strict subset of the added tests in ShiftAndRotateTest. Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Add a similar case for LSHL->LAND pattern Add a similar case for the unsigned variants of the instruction(LUSHR and LUSHL) Rename tryToReplaceLongAndWithRotateInstruction() to tryToReplaceShiftLandWithRotateInstruction() Allocate target register properly in tryToReplaceShiftLandWithRotateInstruction() Add respective Tril test for these changes Remove LongAndRotateAsTest as those tests are now a strict subset of the added tests in ShiftAndRotateTest. Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Add a similar case for LSHL->LAND pattern Add a similar case for the unsigned variants of the instruction(LUSHR and LUSHL) Rename tryToReplaceLongAndWithRotateInstruction() to tryToReplaceShiftLandWithRotateInstruction() Allocate target register properly in tryToReplaceShiftLandWithRotateInstruction() Add respective Tril test for these changes Remove LongAndRotateAsTest as those tests are now a strict subset of the added tests in ShiftAndRotateTest. Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Add a case in genericLongShiftSingle that would generate a RISBG command for a LSHR->LAND pattern Add a similar case for LSHL->LAND pattern Add a similar case for the unsigned variants of the instruction(LUSHR and LUSHL) Rename tryToReplaceLongAndWithRotateInstruction() to tryToReplaceShiftLandWithRotateInstruction() Allocate target register properly in tryToReplaceShiftLandWithRotateInstruction() Add respective Tril test for these changes Remove LongAndRotateAsTest as those tests are now a strict subset of the added tests in ShiftAndRotateTest. Fixes eclipse#3212 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
While working on a miscellaneous item in OpenJ9 I had to use an
RISBG
instruction to perform an and and a shift. Since theRISBG
instructions are slightly confusing in PoPs I wrote a quick Java program and compiled it to validate that I used the correct instruction. Here is the Java program I used and how I invoked it:It generated the following trees:
This sequence can be improved. I think the
SRAG
instruction is redundant as we can shift right and zero out everything else just with theRISBG
instruction. This sequence should be improved to eliminate theSRAG
instruction.The text was updated successfully, but these errors were encountered: