Integrated: 8320448: Accelerate IndexOf using AVX2

2024-06-07 Thread Scott Gibbons
On Tue, 21 Nov 2023 00:06:19 GMT, Scott Gibbons wrote: > Re-write the IndexOf code without the use of the pcmpestri instruction, only > using AVX2 instructions. This change accelerates String.IndexOf on average > 1.3x for AVX2. The benchmark numbers: > &g

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v49]

2024-06-06 Thread Scott Gibbons
On Thu, 30 May 2024 16:20:02 GMT, Emanuel Peter wrote: >> @vnkozlov OK. I'll defer to you all. I've contacted the author of the >> fuzzer to see what I can do to set up a local instance. Would this be >> sufficient to increase confidence for future submissions? We can run it >>

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v52]

2024-06-06 Thread Scott Gibbons
On Thu, 30 May 2024 16:16:45 GMT, Scott Gibbons wrote: >> Re-write the IndexOf code without the use of the pcmpestri instruction, only >> using AVX2 instructions. This change accelerates String.IndexOf on average >> 1.3x for AVX2. The benchmark numbers: &g

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v49]

2024-05-30 Thread Scott Gibbons
On Thu, 30 May 2024 16:10:53 GMT, Vladimir Kozlov wrote: >> About the fuzzer: we have it in our closed tests. But I think it comes from >> this: https://github.com/shipilev/JavaFuzzer > > I agree with @eme64 to postpone the integration after JDK 23 is forked in one > week. It is not about how

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v51]

2024-05-30 Thread Scott Gibbons
On Thu, 30 May 2024 16:03:29 GMT, Emanuel Peter wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix bug number in tests > > src/hotspot/cpu/x86/c2_stubGenerator_x86_64_strin

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v52]

2024-05-30 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v50]

2024-05-30 Thread Scott Gibbons
On Thu, 30 May 2024 15:33:27 GMT, Emanuel Peter wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Review comments > > test/jdk/java/lang/StringBuffer/ECoreIndexOf.java line 33: &g

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v50]

2024-05-30 Thread Scott Gibbons
On Thu, 30 May 2024 15:34:17 GMT, Emanuel Peter wrote: >> test/jdk/java/lang/StringBuffer/ECoreIndexOf.java line 25: >> >>> 23: >>> 24: /* @test >>> 25: * @bug 4162796 4162796 8320448 >> >> Suggestion: >> >> * @bug 8320448 > > As I said above: I never add old bug numbers to new tests. But

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v51]

2024-05-30 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v50]

2024-05-30 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v49]

2024-05-30 Thread Scott Gibbons
On Thu, 30 May 2024 13:50:01 GMT, Emanuel Peter wrote: >> Scott Gibbons has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Stupid EOL at end >> - Add @test block; fix test indentation > > test/jdk/j

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v48]

2024-05-30 Thread Scott Gibbons
On Thu, 30 May 2024 13:56:30 GMT, Emanuel Peter wrote: >> Control question: Are we confident with this potentially going into JDK 23 >> or should we rather postpone to JDK 24? The fork is next week. > >> Control question: Are we confident with this potentially going into JDK 23 >> or should we

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v48]

2024-05-30 Thread Scott Gibbons
On Thu, 30 May 2024 06:25:32 GMT, Tobias Hartmann wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove duplicate vm.compiler2.enabled > > Control question: Are we confident with t

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v48]

2024-05-30 Thread Scott Gibbons
On Thu, 30 May 2024 06:23:05 GMT, Emanuel Peter wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove duplicate vm.compiler2.enabled > > test/jdk/java/lang/String/IndexOf.java l

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v48]

2024-05-30 Thread Scott Gibbons
On Thu, 30 May 2024 06:22:17 GMT, Emanuel Peter wrote: >> test/jdk/java/lang/StringBuffer/ECoreIndexOf.java line 29: >> >>> 27: * @requires vm.cpu.features ~= ".*avx2.*" >>> 28: * @requires vm.compiler2.enabled >>> 29: * @run main/othervm -XX:+UnlockDiagnosticVMOptions >>>

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v49]

2024-05-30 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v47]

2024-05-29 Thread Scott Gibbons
On Wed, 29 May 2024 21:41:42 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Move assert to where it's actually important. > > test/jdk/TEST.ROOT line 103: &g

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v48]

2024-05-29 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v47]

2024-05-29 Thread Scott Gibbons
On Tue, 28 May 2024 23:52:27 GMT, Scott Gibbons wrote: >> Re-write the IndexOf code without the use of the pcmpestri instruction, only >> using AVX2 instructions. This change accelerates String.IndexOf on average >> 1.3x for AVX2. The benchmark numbers: &g

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v47]

2024-05-28 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v46]

2024-05-28 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-28 Thread Scott Gibbons
On Thu, 16 May 2024 18:09:04 GMT, Scott Gibbons wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_string.cpp line 418: >> >>> 416: __ cmpq(haystack_len, 0x10); >>> 417: __ ja_b(L_moreThan16); >>> 418: >> >> An assert here to

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v43]

2024-05-28 Thread Scott Gibbons
On Tue, 28 May 2024 21:17:07 GMT, Scott Gibbons wrote: >> src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 488: >> >>> 486: __ cmpq(r11, nMinusK); >>> 487: __ ja_b(L_return); >>> 488: __ movq(rax, r11); >> >> At places where w

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v43]

2024-05-28 Thread Scott Gibbons
On Tue, 28 May 2024 16:37:23 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix tests > > src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v37]

2024-05-28 Thread Scott Gibbons
On Fri, 24 May 2024 20:42:12 GMT, Scott Gibbons wrote: >> test/jdk/java/lang/StringBuffer/ECoreIndexOf.java line 185: >> >>> 183: } >>> 184: >>> 185: private static int indexOfKernel(String haystack, String needle) { >> >> Is the inte

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v38]

2024-05-28 Thread Scott Gibbons
On Tue, 28 May 2024 16:57:54 GMT, Vladimir Kozlov wrote: >> @vnkozlov I'm getting an error in CI tests with this line added. Can you >> please advise? >> >> `TEST RESULT: Error. Parse Exception: Syntax error in @requires expression: >> invalid name: vm.cpu.features` > > You need to add

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v43]

2024-05-28 Thread Scott Gibbons
On Tue, 28 May 2024 20:56:42 GMT, Scott Gibbons wrote: >> We can also do full reads for (n-k) == 31, as we also compare the kth byte. > > I'll change and test. Passes tests, so I'll change. - PR Review Comment: https://git.openjdk.org/jdk/pull/16753#discussion_r1617886613

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v43]

2024-05-28 Thread Scott Gibbons
On Tue, 28 May 2024 20:37:43 GMT, Sandhya Viswanathan wrote: >> I listed all registers for clarity. This ensures that we know what can be >> used as values or as scratch registers with no ambiguity. > > Sounds good. We could keep only comment out of the two as it is the same for > both small

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v43]

2024-05-28 Thread Scott Gibbons
On Tue, 28 May 2024 20:35:26 GMT, Sandhya Viswanathan wrote: >> No. For (n-k)==32 we can do full reads. I'll clarify by changing the label >> name. > > We can also do full reads for (n-k) == 31, as we also compare the kth byte. I'll change and test. - PR Review Comment:

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v43]

2024-05-28 Thread Scott Gibbons
On Tue, 28 May 2024 20:29:38 GMT, Sandhya Viswanathan wrote: >> No. This is checking for a zero length haystack. The following compare >> checks for needle length longer than haystack, regardless of the value in >> each. The comparison is signed, so a haystack length of 0 with a needle >>

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v43]

2024-05-28 Thread Scott Gibbons
On Tue, 28 May 2024 12:48:19 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix tests > > src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 23

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v45]

2024-05-28 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v44]

2024-05-28 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v41]

2024-05-28 Thread Scott Gibbons
On Sat, 25 May 2024 06:33:51 GMT, Alan Bateman wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix test; review comments > > test/jdk/java/lang/StringBuffer/IndexOf.java line 47:

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v38]

2024-05-28 Thread Scott Gibbons
On Fri, 24 May 2024 20:12:07 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Test clarifications > > test/jdk/java/lang/StringBuffer/IndexOf.java line 28: >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v43]

2024-05-25 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v42]

2024-05-25 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v35]

2024-05-25 Thread Scott Gibbons
On Fri, 24 May 2024 23:04:55 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Review comments - move stubGen*_string.cpp to c2_stubGen*_string.cpp

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v41]

2024-05-25 Thread Scott Gibbons
On Sat, 25 May 2024 00:15:03 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix test; review comments > > src/hotspot/cpu/x86/c2_stubGenerator_x86_64_

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v41]

2024-05-24 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v20]

2024-05-24 Thread Scott Gibbons
On Tue, 21 May 2024 22:39:42 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressing lots of comments. Interim commit. > > src/hotspot/cpu/x86/c2_Ma

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v27]

2024-05-24 Thread Scott Gibbons
On Wed, 22 May 2024 20:36:25 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revert last change to IndexOf.java > > src/hotspot/cpu/x86/stubGenerat

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v25]

2024-05-24 Thread Scott Gibbons
On Wed, 22 May 2024 18:22:24 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> un-helper-ize preload_needle_helper; try fix for macos build

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v35]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 00:09:38 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Review comments - move stubGen*_string.cpp to c2_stubGen*_string.cpp

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v40]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 22:26:56 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Review comments. > > src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp lin

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v37]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 19:30:54 GMT, Volodymyr Paprotski wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> mov64 => lea(InternalAddress) > > src/hotspot/cpu/x86/c2_MacroAssemb

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v40]

2024-05-24 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v38]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 20:12:07 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Test clarifications > > test/jdk/java/lang/StringBuffer/IndexOf.java line 28: >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v39]

2024-05-24 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v18]

2024-05-24 Thread Scott Gibbons
On Wed, 15 May 2024 19:41:58 GMT, Volodymyr Paprotski wrote: >> Scott Gibbons has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 50 commits: >> >> - Merge remote-tracking branch 'origin/master' into indexof

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-24 Thread Scott Gibbons
On Wed, 15 May 2024 19:34:40 GMT, Volodymyr Paprotski wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rearrange; add lambdas for clarity > > test/jdk/java/lang/StringBuffer/IndexOf.

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 18:32:53 GMT, Volodymyr Paprotski wrote: >> Fixed > > (missed a `git add`? don't see the updates for this file) Hmmm... Not sure what happened. >> Since we're only concerned with the delta of performance, does this really >> matter? Can you suggest an alternative? > > The

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v38]

2024-05-24 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v37]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 17:59:49 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> mov64 => lea(InternalAddress) > > My testing for v34 passed without new failures

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v33]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 14:49:05 GMT, Daniel Jeliński wrote: >> Just did the experiment and it turns out that `mov64(r15, >> (int64_t)small_jump_table)` and `lea(r15, >> ExternalAddress(small_jump_table))` produce exactly the same code: >> >> `0x7fffe463d68b: 49 bf a0 d5 63 e4 ff 7f 00 00

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v37]

2024-05-24 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v33]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 06:31:40 GMT, Daniel Jeliński wrote: >> It may, but I believe the movq is shorter (although maybe not to r15). I'll >> do some experimentation. > > the RIP-relative lea should have a shorter encoding. I think something like > `lea(r15, ExternalAddress(small_jump_table))`

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v35]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 00:47:04 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Review comments - move stubGen*_string.cpp to c2_stubGen*_string.cpp > > t

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v33]

2024-05-24 Thread Scott Gibbons
On Fri, 24 May 2024 06:31:36 GMT, Daniel Jeliński wrote: >> Thanks for finding this. It was ignorance on my part as I thought the xorq >> would have logic to not emit the REX prefix if not necessary, but it >> doesn't. Fixed. > > Right, it seems to surprise people. There's a lot of

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v36]

2024-05-24 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v35]

2024-05-23 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v34]

2024-05-23 Thread Scott Gibbons
On Thu, 23 May 2024 22:06:38 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressing review comments > > src/hotspot/cpu/x86/stubGenerator_x86_64.hpp line 5

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v34]

2024-05-23 Thread Scott Gibbons
On Thu, 23 May 2024 21:56:39 GMT, Vladimir Kozlov wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 4250: >> >>> 4248: generate_chacha_stubs(); >>> 4249: >>> 4250: if ((UseAVX == 2) && EnableX86ECoreOpts && >>> VM_Version::supports_avx2()) { >> >> `#ifdef COMPILER2` around this

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v34]

2024-05-23 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v33]

2024-05-23 Thread Scott Gibbons
On Thu, 23 May 2024 19:02:05 GMT, Daniel Jeliński wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix for IndexOf.java on mac > > src/hotspot/cpu/x86/stubGenerator_x86_64_string.cpp

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v33]

2024-05-23 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v32]

2024-05-23 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v31]

2024-05-23 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v30]

2024-05-22 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v29]

2024-05-22 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v28]

2024-05-22 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v27]

2024-05-22 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v26]

2024-05-22 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 > 0

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v25]

2024-05-22 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v24]

2024-05-22 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v22]

2024-05-22 Thread Scott Gibbons
On Wed, 22 May 2024 16:25:24 GMT, Scott Gibbons wrote: >> Re-write the IndexOf code without the use of the pcmpestri instruction, only >> using AVX2 instructions. This change accelerates String.IndexOf on average >> 1.3x for AVX2. The benchmark numbers: &g

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v23]

2024-05-22 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v22]

2024-05-22 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-22 Thread Scott Gibbons
On Fri, 17 May 2024 22:37:13 GMT, Sandhya Viswanathan wrote: >> Not sure what you mean here. I *think* you mean that hsLength is not the >> length of the remaining bytes in the haystack, but the actual length. There >> may be an issue if that is correct, right? I'll investigate. > > Yes,

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v7]

2024-05-22 Thread Scott Gibbons
On Mon, 15 Jan 2024 13:30:42 GMT, Andrey Turbanov wrote: >> Scott Gibbons has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 22 commits: >> >> - Merge branch 'openjdk:master' into indexof >>

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-22 Thread Scott Gibbons
On Wed, 15 May 2024 19:18:27 GMT, Volodymyr Paprotski wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rearrange; add lambdas for clarity > > test/jdk/java/lang/StringBuffer/

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v6]

2024-05-22 Thread Scott Gibbons
On Tue, 9 Jan 2024 15:14:41 GMT, Emanuel Peter wrote: >> Scott Gibbons has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'openjdk:master' into indexof >> - Address

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v7]

2024-05-22 Thread Scott Gibbons
On Mon, 22 Jan 2024 07:08:31 GMT, Jatin Bhateja wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_string.cpp line 505: >> >>> 503: __ cmpb(Address(rbx, r15, Address::times_1, -0xa), rax); >>> 504: __ jne(L_top_loop_1); >>> 505: __ jmp(L_0x406019); >> >> Instead of having special

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v5]

2024-05-22 Thread Scott Gibbons
On Mon, 8 Jan 2024 10:32:51 GMT, Jatin Bhateja wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressing review comments. > > src/hotspot/share/opto/library_call.cpp line 12

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v7]

2024-05-22 Thread Scott Gibbons
On Tue, 16 Jan 2024 13:26:15 GMT, Jatin Bhateja wrote: >> Scott Gibbons has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 22 commits: >> >> - Merge branch 'openjdk:master' into indexof >>

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-22 Thread Scott Gibbons
On Mon, 6 May 2024 23:19:07 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rearrange; add lambdas for clarity > > src/hotspot/cpu/x86/stubGenerator_x86_64_

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v13]

2024-05-22 Thread Scott Gibbons
On Mon, 26 Feb 2024 14:50:30 GMT, Jatin Bhateja wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressed some review coments; replaced hard-coded registers with >> descriptive

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v6]

2024-05-22 Thread Scott Gibbons
On Tue, 9 Jan 2024 15:06:10 GMT, Emanuel Peter wrote: >> Scott Gibbons has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'openjdk:master' into indexof >> - Address

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v20]

2024-05-21 Thread Scott Gibbons
On Fri, 17 May 2024 23:47:45 GMT, Scott Gibbons wrote: >> Re-write the IndexOf code without the use of the pcmpestri instruction, only >> using AVX2 instructions. This change accelerates String.IndexOf on average >> 1.3x for AVX2. The benchmark numbers: &g

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v20]

2024-05-21 Thread Scott Gibbons
On Tue, 21 May 2024 18:03:41 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressing lots of comments. Interim commit. > > src/hotspot/cpu/x86/c2_Ma

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v21]

2024-05-21 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-17 Thread Scott Gibbons
On Wed, 15 May 2024 19:18:02 GMT, Volodymyr Paprotski wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rearrange; add lambdas for clarity > > test/jdk/java/lang/StringBuffer/

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-17 Thread Scott Gibbons
On Tue, 14 May 2024 00:38:30 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rearrange; add lambdas for clarity > > src/hotspot/cpu/x86/stubGenerat

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-17 Thread Scott Gibbons
On Tue, 14 May 2024 18:38:38 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rearrange; add lambdas for clarity > > src/hotspot/cpu/x86/stubGenerat

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-17 Thread Scott Gibbons
On Fri, 17 May 2024 22:40:50 GMT, Sandhya Viswanathan wrote: >> The entry code switches Windows calling convention into Linux calling >> convention by moving/saving registers, which are properly restored on >> function exit. This makes register tracking easier. > > I don't see the place

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v20]

2024-05-17 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v7]

2024-05-16 Thread Scott Gibbons
On Tue, 16 Jan 2024 12:09:11 GMT, Jatin Bhateja wrote: >> Scott Gibbons has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 22 commits: >> >> - Merge branch 'openjdk:master' into indexof >>

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-16 Thread Scott Gibbons
On Mon, 6 May 2024 20:56:36 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rearrange; add lambdas for clarity > > src/hotspot/cpu/x86/macroAssembler

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-16 Thread Scott Gibbons
On Tue, 7 May 2024 17:25:04 GMT, Volodymyr Paprotski wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rearrange; add lambdas for clarity > > src/hotspot/cpu/x86/c2_MacroAssembler

Re: RFR: 8320448: Accelerate IndexOf using AVX2 [v19]

2024-05-04 Thread Scott Gibbons
62260014x > StringIndexOfChar.latin1_Short_char 16013.389 16162.437 > 1.009307711x > StringIndexOfChar.latin1_mixed_String 7386.12314771.622 > 1.999915517x > StringIndexOfChar.latin1_mixed_char 9901.671 9782.245 >

  1   2   3   >