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

Z array cmp sign returns -2 instead of -1 #7135

Open
ehsankianifar opened this issue Oct 5, 2023 · 2 comments
Open

Z array cmp sign returns -2 instead of -1 #7135

ehsankianifar opened this issue Oct 5, 2023 · 2 comments

Comments

@ehsankianifar
Copy link
Contributor

Array compare signed supposed to return -1/0/1 based on the comparison result but it returns -2 instead of -1. This is a result of using IPM instruction to generate result here and here!
Increasing the shift right one more bit would solve the issue for -1 but it would destroy the +1 result! In worst case scenario, we can revert back to use branching approach as specified here but it may damage the performance!

@ehsankianifar
Copy link
Contributor Author

Test and reproduce the issue:
I used the existing compiler tril tests here to test produce this issue. The tests cover 1/0/2 (unsigned) code path only so I needed to add flags=[14] which enables the sign flag to the tree definition then build and run the tests.

@ehsankianifar
Copy link
Contributor Author

FYI @Spencer-Comin and @r30shah

ehsankianifar added a commit to ehsankianifar/omr that referenced this issue Oct 10, 2023
The isArrayCmpSign function accept only arraycmp opcode
Removed from arraycmplen since sign doesnt mean anything there

Fix: eclipse#7135 Signed-off-by: ehsan kiani far ehsan.kianifar@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant