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

AArch64: Implement tableEvaluator #4633

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

knn-k
Copy link
Contributor

@knn-k knn-k commented Dec 4, 2019

This commit implements tableEvaluator() for AArch64.

Co-authored-by: KONNO Kazuhiro konno@jp.ibm.com
Co-authored-by: Aaron Graham aaron.graham@unb.ca
Co-authored-by: Md. Mahbubur Rahman mrahma15@unb.ca

Signed-off-by: KONNO Kazuhiro konno@jp.ibm.com

This commit implements tableEvaluator() for AArch64.

Co-authored-by: KONNO Kazuhiro konno@jp.ibm.com
Co-authored-by: Aaron Graham aaron.graham@unb.ca
Co-authored-by: Md. Mahbubur Rahman mrahma15@unb.ca

Signed-off-by: KONNO Kazuhiro <konno@jp.ibm.com>
@knn-k knn-k requested a review from 0xdaryl as a code owner December 4, 2019 08:39
@knn-k
Copy link
Contributor Author

knn-k commented Dec 4, 2019

This PR is based on the code from #4214.

It generates the following instruction sequence for the 5 <= numBranchTableEntries case.

b.cs Label for default child
adr tmpReg, #12 // tmpReg points to the first instruction of the jump table
add tmpReg, tmpReg, selectorReg, lsl #2 // tmpReg = selectorReg*4 + tmpReg
br tmpReg
b Label Lxxxx
b Label Lxxxx
b Label Lxxxx

}
else
{
if (!constantIsUnsignedImm12(numBranchTableEntries))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this if condition is being overly defensive. You already know from the if guarding entry to this code that the numBranchTableEntries is <= 5. I'd say just do the generateCompareImmInstruction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numBranchTableEntries is >=5 here. So it is possible that exceeds the range of unsigned imm12.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh. I read the condition above incorrectly.

@0xdaryl
Copy link
Contributor

0xdaryl commented Dec 4, 2019

@genie-omr build aarch64

@0xdaryl 0xdaryl self-assigned this Dec 4, 2019
@0xdaryl 0xdaryl merged commit f19cb88 into eclipse-omr:master Dec 4, 2019
@knn-k knn-k deleted the aarch64tableEval branch December 4, 2019 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants