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 check for header size >= 16 would be good. >> Also a

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

2024-05-24 Thread Volodymyr Paprotski
On Wed, 22 May 2024 14:50:40 GMT, Scott Gibbons wrote: >> test/jdk/java/lang/StringBuffer/IndexOf.java line 284: >> >>> 282: >>> 283: // Note: it is possible although highly improbable that failCount >>> will >>> 284: // be > 0 even if everthing is working ok >> >> This sounds like

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.java line 90: > >> 88: >> 89:

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 [v19]

2024-05-24 Thread Volodymyr Paprotski
On Fri, 17 May 2024 23:59:05 GMT, Scott Gibbons wrote: >> test/jdk/java/lang/StringBuffer/IndexOf.java line 40: >> >>> 38: private static boolean failure = false; >>> 39: public static void main(String[] args) throws Exception { >>> 40: String testName = "IndexOf"; >> >> intentation >

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

2024-05-24 Thread Volodymyr Paprotski
On Wed, 22 May 2024 14:41:36 GMT, Scott Gibbons wrote: >> test/micro/org/openjdk/bench/java/lang/StringIndexOfHuge.java line 132: >> >>> 130: @Benchmark >>> 131: public int searchHugeLargeSubstring() { >>> 132: return dataStringHuge.indexOf("B".repeat(30) + "X" + >>> "A".repeat(30),

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 [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/IndexOf.java line 54: > >> 52: //

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_string.cpp line 329: > >>

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/IndexOf.java line 40: > >> 38:

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/stubGenerator_x86_64_string.cpp line 1178: > >>

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/stubGenerator_x86_64_string.cpp line 1784: > >>

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 [v19]

2024-05-17 Thread Sandhya Viswanathan
On Thu, 16 May 2024 17:08:21 GMT, Scott Gibbons wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_string.cpp line 238: >> >>> 236: const Register needle = rdx; >>> 237: const Register needle_len = rcx; >>> 238: >> >> This is the calling convention on Linux. How is windows

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

2024-05-17 Thread Sandhya Viswanathan
On Thu, 16 May 2024 20:22:40 GMT, Scott Gibbons wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_string.cpp line 1510: >> >>> 1508: compare_big_haystack_to_needle(sizeKnown, size, >>> NUMBER_OF_NEEDLE_BYTES_TO_COMPARE, loop_top, hsPtrRet, hsLength, >>> 1509:

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_x86.cpp line 1174: > >> 1172: //

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_x86.cpp line 4492: > >> 4490: >>

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

2024-05-15 Thread Sandhya Viswanathan
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-15 Thread Volodymyr Paprotski
On Wed, 15 May 2024 19:21:37 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.java line 47: > >> 45:

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

2024-05-15 Thread Volodymyr Paprotski
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-14 Thread Sandhya Viswanathan
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-13 Thread Sandhya Viswanathan
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-13 Thread Volodymyr Paprotski
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-13 Thread Sandhya Viswanathan
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-07 Thread Sandhya Viswanathan
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-07 Thread Sandhya Viswanathan
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-07 Thread Sandhya Viswanathan
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-06 Thread Sandhya Viswanathan
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-06 Thread Sandhya Viswanathan
On Sat, 4 May 2024 19:35:21 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: >> >> >> Benchmark

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

2024-05-04 Thread Scott Gibbons
> 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: > > > BenchmarkScore > Latest