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

x86-64: Inline small array copy size for int and long arrays #7362

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

a7ehuo
Copy link
Contributor

@a7ehuo a7ehuo commented Jun 6, 2024

(1)
Inline small array copy size without using rep movs for int array and long array

  • If AVX-512 is supported and copy size <= 128 bytes, the inlined copy sequence is used.
  • If AVX is supported, the threshold for inlined sequence is 64 bytes instead.
  • The enhancement for 32 bit and 64 bit arrays will be reused in the downstream OpenJ9 project for reference arrays.

(2)
Refactor char array enhancement implementation to support both rep movsw and rep movsd if the copysize is greater than the supported enhancement threshold.

(3)
Add the following options to disable the enhancement

  • disableArrayCopyIntArrayInlineSmallSizeWithoutREPMOVS: disable the enhancement for int array

  • disableArrayCopyLongArrayInlineSmallSizeWithoutREPMOVS: disable the enhancement for long array

  • disableArrayCopyReferenceArrayInlineSmallSizeWithoutREPMOVS: disable the enhancement for reference array, which will be implemented in downstream project OpenJ9.

@a7ehuo
Copy link
Contributor Author

a7ehuo commented Jun 6, 2024

@0xdaryl May I ask you to review this change? Thank you!

@vijaysun-omr @hzongaro fyi

(1)
Inline small array copy size without using `rep movs`
for int array and long array
  - If AVX-512 is supported and copy size <= 128 bytes,
    the inlined copy sequence is used.
  - If AVX is supported, the threshold for inlined sequence
    is 64 bytes instead.
  - The enhancement for 32 bit and 64 bit arrays will be reused
    in the downstream OpenJ9 project for reference arrays.

(2)
Refactor char array enhancement implementation to support
both `rep movsw` and `rep movsd` if the copysize is greater
than the supported enhancement threshold.

(3)
Add the following options to disable the enhancement
  - `disableArrayCopyIntArrayInlineSmallSizeWithoutREPMOVS`:
    disable the enhancement for int array

  - `disableArrayCopyLongArrayInlineSmallSizeWithoutREPMOVS`:
    disable the enhancement for long array

  - `disableArrayCopyReferenceArrayInlineSmallSizeWithoutREPMOVS`:
    disable the enhancement for reference array, which will be
    implemented in downstream project OpenJ9.

Signed-off-by: Annabelle Huo <Annabelle.Huo@ibm.com>
@a7ehuo a7ehuo force-pushed the system-arraycopy-perf-12-int-long branch from e26efe4 to 2a2e130 Compare June 6, 2024 12:47
@a7ehuo a7ehuo changed the title Inline small array copy size for int and long arrays x86-64: Inline small array copy size for int and long arrays Jun 6, 2024
@0xdaryl 0xdaryl self-assigned this Jun 7, 2024
@0xdaryl
Copy link
Contributor

0xdaryl commented Jun 7, 2024

Jenkins build xlinux,xmac,win,x32linux

@0xdaryl 0xdaryl merged commit 4856f9d into eclipse:master Jun 7, 2024
9 checks passed
a7ehuo added a commit to a7ehuo/omr that referenced this pull request Jun 7, 2024
…perf-12-int-long"

This reverts commit 4856f9d, reversing
changes made to 361c9df.
rmnattas pushed a commit to rmnattas/omr that referenced this pull request Jun 14, 2024
…perf-12-int-long"

This reverts commit 4856f9d, reversing
changes made to 361c9df.
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.

None yet

2 participants