Skip to content

Simplify SupportsConst(I|L)Div to Supports(I|L)MulHigh - #7082

Merged
knn-k merged 2 commits into
eclipse-omr:masterfrom
jmesyou:refactor/const-div
Aug 10, 2023
Merged

knn-k merged 2 commits into
eclipse-omr:masterfrom
jmesyou:refactor/const-div

Conversation

@jmesyou

@jmesyou jmesyou commented Jul 31, 2023 •

Copy link
Copy Markdown
Contributor

This commit is motivated by eclipse-openj9/openj9#17861.
A check whether the underlying target supports 64 bit multiplication returning the high word is needed
in order to intrinsify java.lang.Math.multiplyHigh

As a side effect, this has simplified the
SupportsConst(I|L)Div checks as they are transitive to the newly added checks

This is commit is motivated by openj9#17861.
A check whether the underlying target supports 64 bit
multiplication returning the high word is needed
in order to intrinsify java.lang.Math.multiplyHigh

As a side effect, this has simplified the
SupportsConst(I|L)Div checks as they are transitive
to the newly added checks

Signed-off-by: James You <james.you@protonmail.com>
@knn-k

knn-k commented Jul 31, 2023

Copy link
Copy Markdown
Contributor

Please change the aarch64 code, too.
32-bit arm and aarch64 don't share code generator code.

jmesyou added a commit to jmesyou/openj9 that referenced this pull request Aug 1, 2023
See eclipse-omr/omr#7082

Depends on: eclipse-omr/omr#7082

Signed-off-by: James You <james.you@protonmail.com>
Previously, the multiply high feature flag was not enabled
for aarch64. This change sets the flag and enables the
fast constant division optimization.

Signed-off-by: James You <james.you@protonmail.com>
@jmesyou

jmesyou commented Aug 1, 2023 •

Copy link
Copy Markdown
Contributor Author

@knn-k The aarch64 code gen did not originally set the SupportsConstIDiv flag, so I've added the new flag as part of an additional commit.

@knn-k

knn-k commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

Is there any reason for not setting the flag for IMulHigh on aarch64? I have the same question for LMulHigh on p.

  • aarch64: LMulHigh (codegen has imulhEvaluator)
  • arm: IMulHigh
  • p: IMulHigh (codegen has lmulhEvaluator)
  • x86-32: IMulHigh
  • x86-64: IMulHigh and LMulHigh
  • z: IMulHigh

@jmesyou

jmesyou commented Aug 4, 2023

Copy link
Copy Markdown
Contributor Author

I see no reason that it shouldn't be set. I did not set them because those code gens did not originally set the SupportsConstIDiv flag (or vice versa) so that may have been previous oversight. I can push a new change which sets the missing flags for arm64 and power.

@knn-k

knn-k commented Aug 7, 2023

Copy link
Copy Markdown
Contributor

Other reviewers, any comments?

@knn-k

knn-k commented Aug 10, 2023

Copy link
Copy Markdown
Contributor

Jenkins build all,amac

@knn-k

knn-k commented Aug 10, 2023

Copy link
Copy Markdown
Contributor

Jenkins build win

@knn-k

knn-k commented Aug 10, 2023

Copy link
Copy Markdown
Contributor

Jenkins build zlinux

@knn-k knn-k self-assigned this Aug 10, 2023
@knn-k
knn-k merged commit d292034 into eclipse-omr:master Aug 10, 2023
@knn-k

knn-k commented Aug 10, 2023

Copy link
Copy Markdown
Contributor

It didn't notice that I had to perform a coordinated merge with eclipse-openj9/openj9#17892.
I opened #7085 to revert this.

@knn-k

knn-k commented Aug 10, 2023

Copy link
Copy Markdown
Contributor

@jmesyou My apologies. Please open a new pull request after #7085 is merged.

@jmesyou

jmesyou commented Aug 22, 2023

Copy link
Copy Markdown
Contributor Author

Reopened in #7095

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