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
8269559: AArch64: Implement string_compare intrinsic in SVE #5129
Conversation
This patch implements string_compare intrinsic in SVE. It supports all LL, LU, UL and UU comparisons. As we haven't found an existing benchmark to measure performance impact, we created a benchmark derived from the test [1] for this evaluation. This benchmark is attached to this patch. Besides, remove the unused temporary register `vtmp3` from the existing match rules for StrCmp. The result below shows all varients can be benefited largely. Command: make exploded-test TEST="micro:StringCompareToDifferentLength" Benchmark (size) Mode Cnt Score Speedup Units compareToLL 24 avgt 10 1.0x ms/op compareToLL 36 avgt 10 1.0x ms/op compareToLL 72 avgt 10 1.0x ms/op compareToLL 128 avgt 10 1.4x ms/op compareToLL 256 avgt 10 1.8x ms/op compareToLL 512 avgt 10 2.7x ms/op compareToLU 24 avgt 10 1.6x ms/op compareToLU 36 avgt 10 1.8x ms/op compareToLU 72 avgt 10 2.3x ms/op compareToLU 128 avgt 10 3.8x ms/op compareToLU 256 avgt 10 4.7x ms/op compareToLU 512 avgt 10 6.3x ms/op compareToUL 24 avgt 10 1.6x ms/op compareToUL 36 avgt 10 1.7x ms/op compareToUL 72 avgt 10 2.2x ms/op compareToUL 128 avgt 10 3.3x ms/op compareToUL 256 avgt 10 4.4x ms/op compareToUL 512 avgt 10 6.1x ms/op compareToUU 24 avgt 10 1.0x ms/op compareToUU 36 avgt 10 1.0x ms/op compareToUU 72 avgt 10 1.4x ms/op compareToUU 128 avgt 10 2.2x ms/op compareToUU 256 avgt 10 2.6x ms/op compareToUU 512 avgt 10 3.7x ms/op [1] https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/intrinsics/string/TestStringCompareToDifferentLength.java
|
@tatwaichong The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
%} | ||
ins_pipe(pipe_class_memory); | ||
%} | ||
|
||
instruct string_compareUL(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, | ||
iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, | ||
vRegD_V0 vtmp1, vRegD_V1 vtmp2, vRegD_V2 vtmp3, rFlagsReg cr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think vtmp3 (=V2) is still used by the non-SVE compare-long-strings stub? (see generate_compare_long_string_different_encoding
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Nick.
Yes. I remove this vtmp3 from input arguments wrongly. I roll back this mistake in the following patch.
… compare-long-strings stub. And remove the assertion in `string_compare` since it won't help as the registers used in the stub are fixed.
This looks ok to me now but please wait to see if @theRealAph has any comments. I suppose the the short-string comparison code which is expanded at the call site could also benefit from SVE, if only to make it shorter.
@tatwaichong This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@nick-arm, @theRealAph) but any other Committer may sponsor as well.
|
@tatwaichong This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@theRealAph Hello, Andrew. I'm wondering are you interested in reviewing this patch? I believe your feedback and comment are useful to it. |
@tatwaichong this pull request can not be integrated into git checkout sve_compareto
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
/integrate |
@tatwaichong |
/sponsor |
Going to push as commit 8b1b6f9. |
@nick-arm @tatwaichong Pushed as commit 8b1b6f9. |
Mailing list message from David Holmes on core-libs-dev: We are seeing a large number of Aarch64 test failures in our CI after I think we will need to back this change out while this is investigated David On 14/10/2021 3:30 pm, TatWai Chong wrote: |
Hm, I didn't see anything like that when we tested this patch internally. I'll create another PR to revert it for now. |
Mailing list message from David Holmes on core-libs-dev: On 14/10/2021 4:28 pm, Nick Gasson wrote:
Filed: https://bugs.openjdk.java.net/browse/JDK-8275263 If a backout is needed then it should be converted to a "backout" issue per: https://openjdk.java.net/guide/index.html#backing-out-a-change Thanks, |
This patch implements string_compare intrinsic in SVE.
It supports all LL, LU, UL and UU comparisons.
As we haven't found an existing benchmark to measure performance impact,
we created a benchmark derived from the test [1] for this evaluation.
This benchmark is attached to this patch.
Besides, remove the unused temporary register
vtmp3
from the existingmatch rules for StrCmp.
The result below shows all varients can be benefited largely.
Command: make exploded-test TEST="micro:StringCompareToDifferentLength"
Benchmark (size) Mode Cnt Score Speedup Units
compareToLL 24 avgt 10 1.0x ms/op
compareToLL 36 avgt 10 1.0x ms/op
compareToLL 72 avgt 10 1.0x ms/op
compareToLL 128 avgt 10 1.4x ms/op
compareToLL 256 avgt 10 1.8x ms/op
compareToLL 512 avgt 10 2.7x ms/op
compareToLU 24 avgt 10 1.6x ms/op
compareToLU 36 avgt 10 1.8x ms/op
compareToLU 72 avgt 10 2.3x ms/op
compareToLU 128 avgt 10 3.8x ms/op
compareToLU 256 avgt 10 4.7x ms/op
compareToLU 512 avgt 10 6.3x ms/op
compareToUL 24 avgt 10 1.6x ms/op
compareToUL 36 avgt 10 1.7x ms/op
compareToUL 72 avgt 10 2.2x ms/op
compareToUL 128 avgt 10 3.3x ms/op
compareToUL 256 avgt 10 4.4x ms/op
compareToUL 512 avgt 10 6.1x ms/op
compareToUU 24 avgt 10 1.0x ms/op
compareToUU 36 avgt 10 1.0x ms/op
compareToUU 72 avgt 10 1.4x ms/op
compareToUU 128 avgt 10 2.2x ms/op
compareToUU 256 avgt 10 2.6x ms/op
compareToUU 512 avgt 10 3.7x ms/op
[1] https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/intrinsics/string/TestStringCompareToDifferentLength.java
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5129/head:pull/5129
$ git checkout pull/5129
Update a local copy of the PR:
$ git checkout pull/5129
$ git pull https://git.openjdk.java.net/jdk pull/5129/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5129
View PR using the GUI difftool:
$ git pr show -t 5129
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5129.diff