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

Accelerate Java bit compress and expand methods #19202

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Spencer-Comin
Copy link
Contributor

Map the following Java methods to the following IL opcodes:

  • Integer.compress to icompressbits
  • Integer.expand to iexpandbits
  • Long.compress to lcompressbits
  • Long.expand to lexpandbits

Relies on eclipse/omr#7259

Signed-off-by: Spencer Comin <spencer.comin@ibm.com>
This commit the following Java methods to the following IL opcodes:
 - Integer.compress to icompressbits
 - Integer.expand to iexpandbits
 - Long.compress to lcompressbits
 - Long.expand to lexpandbits

Signed-off-by: Spencer Comin <spencer.comin@ibm.com>
@Spencer-Comin
Copy link
Contributor Author

Spencer-Comin commented Apr 10, 2024

Here's an infodump with the IL transformations and the acceleration that I've measured on P and X

Method Before recognizedCallTransformer After recognizedCallTransformer Speedup (x86 Broadwell) Speedup (POWER10)
Integer.compress
icall  java/lang/Integer.compress(II)I
iload <parm 0 I>
iload <parm 1 I>
icompressbits
iload <parm 0 I>
iload <parm 1 I>
20.28x 3.48x
Integer.expand
icall  java/lang/Integer.expand(II)I
iload <parm 0 I>
iload <parm 1 I>
iexpandbits
iload <parm 0 I>
iload <parm 1 I>
18.19x 3.68x
Long.compress
lcall  java/lang/Long.compress(JJ)J
lload <parm 0 J>
lload <parm 1 J>
lcompressbits
lload <parm 0 J>
lload <parm 1 J>
28.77x 5.20x
Long.expand
lcall  java/lang/Long.expand(JJ)J
lload <parm 0 J>
lload <parm 1 J>
lexpandbits
lload <parm 0 J>
lload <parm 1 J>
28.25x 6.03x

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

Successfully merging this pull request may close these issues.

None yet

1 participant