Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v26]

2024-04-24 Thread Tobias Hartmann
On Sat, 20 Apr 2024 22:31:48 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v26]

2024-04-21 Thread Jatin Bhateja
On Sat, 20 Apr 2024 22:31:48 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v26]

2024-04-21 Thread Scott Gibbons
On Sat, 20 Apr 2024 22:31:48 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v26]

2024-04-21 Thread Vladimir Kozlov
On Sat, 20 Apr 2024 22:31:48 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v25]

2024-04-20 Thread Scott Gibbons
On Sat, 20 Apr 2024 19:09:43 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v26]

2024-04-20 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v25]

2024-04-20 Thread Vladimir Kozlov
On Sat, 20 Apr 2024 19:09:43 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v24]

2024-04-20 Thread Scott Gibbons
On Sat, 20 Apr 2024 04:28:43 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Long to short jmp; other cleanup > > `runtime/Unsafe/InternalErrorTest.java` test SIGBUS when run with `-Xcomp` >

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v24]

2024-04-20 Thread Scott Gibbons
On Fri, 19 Apr 2024 22:08:52 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v24]

2024-04-20 Thread Scott Gibbons
On Sat, 20 Apr 2024 14:14:59 GMT, Jatin Bhateja wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Long to short jmp; other cleanup > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2530: > >> 2528:

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v25]

2024-04-20 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v24]

2024-04-20 Thread Jatin Bhateja
On Fri, 19 Apr 2024 22:08:52 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v24]

2024-04-19 Thread Vladimir Kozlov
On Fri, 19 Apr 2024 22:08:52 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v24]

2024-04-19 Thread Vladimir Kozlov
On Fri, 19 Apr 2024 22:08:52 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v23]

2024-04-19 Thread Scott Gibbons
On Fri, 19 Apr 2024 20:58:43 GMT, Vladimir Kozlov wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2638: >> >>> 2636:L_exit, _masm); >>> 2637: } >>> 2638: __ jmp(L_exit); >> >> Here is long jump to `L_exit` after `do_setmemory_atomic_

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v23]

2024-04-19 Thread Scott Gibbons
On Fri, 19 Apr 2024 20:53:31 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Review comments > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2550: > >> 2548: >> 2549: // If

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v24]

2024-04-19 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v23]

2024-04-19 Thread Vladimir Kozlov
On Fri, 19 Apr 2024 20:54:32 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Review comments > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2638: > >> 2636:

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v23]

2024-04-19 Thread Vladimir Kozlov
On Fri, 19 Apr 2024 20:13:03 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Jorn Vernee
On Fri, 19 Apr 2024 19:18:13 GMT, Scott Gibbons wrote: >> src/hotspot/share/opto/runtime.cpp line 786: >> >>> 784: fields[argp++] = TypePtr::NOTNULL;// dest >>> 785: fields[argp++] = TypeLong::LONG; // size >>> 786: fields[argp++] = Type::HALF; // size >> >> Since the si

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Scott Gibbons
On Fri, 19 Apr 2024 18:16:33 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add enter() and leave(); remove Windows-specific register stuff > > src/hotspot/share/utilities/copy.hpp line 303:

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Scott Gibbons
On Fri, 19 Apr 2024 15:50:05 GMT, Jorn Vernee wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add enter() and leave(); remove Windows-specific register stuff > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v22]

2024-04-19 Thread Scott Gibbons
On Fri, 19 Apr 2024 17:42:36 GMT, Jorn Vernee wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Address review comments; update copyright years > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2523: >

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Scott Gibbons
On Fri, 19 Apr 2024 18:14:05 GMT, Vladimir Kozlov wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 4013: >> >>> 4011: // Initialize table for unsafe copy memeory check. >>> 4012: if (UnsafeMemoryAccess::_table == nullptr) { >>> 4013: UnsafeMemoryAccess::create_table(26); >> >

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v22]

2024-04-19 Thread Scott Gibbons
On Fri, 19 Apr 2024 18:25:17 GMT, Vladimir Kozlov wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Address review comments; update copyright years > > General comment/suggestion before I dive into review. > Can we

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v23]

2024-04-19 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v22]

2024-04-19 Thread Vladimir Kozlov
On Fri, 19 Apr 2024 16:25:28 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Vladimir Kozlov
On Fri, 19 Apr 2024 15:43:17 GMT, Jorn Vernee wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add enter() and leave(); remove Windows-specific register stuff > > src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 4

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v22]

2024-04-19 Thread Jorn Vernee
On Fri, 19 Apr 2024 16:25:28 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Jorn Vernee
On Tue, 16 Apr 2024 00:04:15 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v22]

2024-04-19 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Scott Gibbons
On Fri, 19 Apr 2024 13:25:33 GMT, Jatin Bhateja wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add enter() and leave(); remove Windows-specific register stuff > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycop

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-19 Thread Jatin Bhateja
On Tue, 16 Apr 2024 00:04:15 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-18 Thread Sandhya Viswanathan
On Tue, 16 Apr 2024 00:04:15 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-16 Thread Scott Gibbons
On Tue, 16 Apr 2024 00:04:15 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-15 Thread Sandhya Viswanathan
On Tue, 16 Apr 2024 00:04:15 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v21]

2024-04-15 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v20]

2024-04-15 Thread Scott Gibbons
On Mon, 15 Apr 2024 23:06:11 GMT, Sandhya Viswanathan wrote: >> `_WIN32` is also defined for 64 bit Windows > > Thanks, I missed that. I'm changing the scheme here to c_rargX, so no need for any windows-specific stuff. I added it when I needed 4 scratch registers. - PR Review Co

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v20]

2024-04-15 Thread Sandhya Viswanathan
On Mon, 15 Apr 2024 23:01:21 GMT, Jorn Vernee wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2686: >> >>> 2684: __ movq(rdx, rsi); >>> 2685: restore_arg_regs(); >>> 2686: #endif >> >> This is stubGenerator_x86_64.cpp 64bit specific, so WIN32 portion could be

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v20]

2024-04-15 Thread Jorn Vernee
On Mon, 15 Apr 2024 22:22:38 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix memory mark after sync to upstream > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2686: >

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v14]

2024-04-15 Thread Sandhya Viswanathan
On Fri, 12 Apr 2024 16:47:58 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v20]

2024-04-15 Thread Sandhya Viswanathan
On Mon, 15 Apr 2024 18:43:24 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v20]

2024-04-15 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v19]

2024-04-15 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v18]

2024-04-15 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v17]

2024-04-15 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v16]

2024-04-15 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v15]

2024-04-15 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v14]

2024-04-12 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v12]

2024-04-12 Thread Scott Gibbons
On Fri, 12 Apr 2024 00:23:33 GMT, Sandhya Viswanathan wrote: >> It would not be appropriate to add set memory marks to the existing >> _jbyte_fill as it is being used by other routines, and the effect of the >> mark will be very hard to track down (if any). >> >> Are you *sure* we want to do

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v13]

2024-04-12 Thread Scott Gibbons
On Fri, 12 Apr 2024 00:14:29 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressing yet more review comments > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2504: > >

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v13]

2024-04-12 Thread Scott Gibbons
On Fri, 12 Apr 2024 00:25:34 GMT, Sandhya Viswanathan wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2521: >> >>> 2519: const Register byteVal = rdx; >>> 2520: >>> 2521: // Propagate byte to full Register >> >> The comment refers to lines 2524-2526, please m

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v13]

2024-04-11 Thread Sandhya Viswanathan
On Fri, 12 Apr 2024 00:10:22 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressing yet more review comments > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2521: > >

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v13]

2024-04-11 Thread Sandhya Viswanathan
On Fri, 12 Apr 2024 00:07:56 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v12]

2024-04-11 Thread Sandhya Viswanathan
On Fri, 12 Apr 2024 00:00:38 GMT, Scott Gibbons wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2751: >> >>> 2749: UnsafeSetMemoryMark usmm(this, true, true); >>> 2750: >>> 2751: __ generate_fill(T_BYTE, false, c_rarg0, c_rarg1, r11, rax, >>> xmm0); >> >>

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v12]

2024-04-11 Thread Scott Gibbons
On Fri, 12 Apr 2024 00:03:10 GMT, Scott Gibbons wrote: >> test/jdk/sun/misc/CopyMemory.java line 214: >> >>> 212: random.setSeed(seed); >>> 213: System.out.println("Seed set to "+ seed); >>> 214: >> >> Looks like these lines were added for debugging, could be removed. > > Yes,

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v12]

2024-04-11 Thread Scott Gibbons
On Thu, 11 Apr 2024 23:30:07 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressing more review comments > > src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2751: > >> 27

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v11]

2024-04-11 Thread Scott Gibbons
On Thu, 11 Apr 2024 22:00:01 GMT, Sandhya Viswanathan wrote: >> No. Reviewing the code I saw this as a potential error, as >> `arraycopy_avx3_large` could cause a SIGBUS which wouldn't be caught. It >> conforms to the other instances of copy in the code. I think it was missed >> by the ori

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v13]

2024-04-11 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v12]

2024-04-11 Thread Sandhya Viswanathan
On Thu, 11 Apr 2024 21:47:01 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v11]

2024-04-11 Thread Sandhya Viswanathan
On Thu, 11 Apr 2024 20:58:00 GMT, Scott Gibbons wrote: >> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 735: >> >>> 733: >>> 734: if (MaxVectorSize == 64) { >>> 735: UnsafeCopyMemoryMark ucmm(this, !is_oop && !aligned, false, >>> ucme_exit_pc); >> >> This is not related to

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v12]

2024-04-11 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v11]

2024-04-11 Thread Scott Gibbons
On Thu, 11 Apr 2024 20:08:18 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix whitespace error. > > src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp line 8343: > >> 8341: Unsaf

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v11]

2024-04-11 Thread Sandhya Viswanathan
On Thu, 11 Apr 2024 18:42:56 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v11]

2024-04-11 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v9]

2024-04-11 Thread Scott Gibbons
On Thu, 11 Apr 2024 18:17:01 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performanc

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v10]

2024-04-11 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v9]

2024-04-11 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v8]

2024-04-11 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v7]

2024-04-11 Thread Scott Gibbons
On Thu, 11 Apr 2024 00:38:11 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add movq to locate_operand > > src/hotspot/cpu/x86/macroAssembler_x86.cpp line 5988: > >> 5986: movw(Addr

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v7]

2024-04-10 Thread Sandhya Viswanathan
On Mon, 8 Apr 2024 19:11:19 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performance

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v7]

2024-04-10 Thread Sandhya Viswanathan
On Mon, 8 Apr 2024 19:11:19 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performance

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v7]

2024-04-10 Thread Sandhya Viswanathan
On Mon, 8 Apr 2024 19:11:19 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performance

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v6]

2024-04-10 Thread Maurizio Cimadamore
On Tue, 9 Apr 2024 23:45:39 GMT, Scott Gibbons wrote: > Is there any way to disable some of the optimizations C2 will attempt on the > IR? We need to maintain atomicity, so vectorization shouldn't occur, for > instance. This seems like a rat-hole that would need constant maintenance as > C2 op

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v6]

2024-04-09 Thread Scott Gibbons
On Sun, 7 Apr 2024 05:14:08 GMT, Francesco Nigro wrote: >> I went ahead and tried a pure-Java implementation, and it is faster for >> small sizes (up to 8) and only about 1.5x slower for larger sizes, so that >> might make for an interesting fallback if there is no customized assembler >> impl

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v4]

2024-04-09 Thread Maurizio Cimadamore
On Fri, 5 Apr 2024 02:40:16 GMT, Dean Long wrote: > That way C2 can do all its usual optimizations, like unrolling, > vectorization, and redundant store elimination (if it is an on-heap primitive > array that was just allocated, then there is no need to zero the parts that > are being "set").

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v7]

2024-04-08 Thread Dean Long
On Mon, 8 Apr 2024 19:11:19 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performance

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v7]

2024-04-08 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v6]

2024-04-06 Thread Francesco Nigro
On Sun, 7 Apr 2024 01:49:01 GMT, Dean Long wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Oops > > I went ahead and tried a pure-Java implementation, and it is faster for small > sizes (up to 8) and only about 1

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v6]

2024-04-06 Thread Dean Long
On Sat, 6 Apr 2024 00:13:26 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performance

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v6]

2024-04-05 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v5]

2024-04-05 Thread Scott Gibbons
On Fri, 5 Apr 2024 21:53:50 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performance

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v5]

2024-04-05 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v4]

2024-04-04 Thread Dean Long
On Wed, 3 Apr 2024 15:15:24 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performance

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v2]

2024-04-04 Thread David Holmes
On Tue, 2 Apr 2024 02:16:07 GMT, David Holmes wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Use non-sse fill (old left in) > > This looks like it is still a Draft/work-in-progress. There is only code for > x64

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v4]

2024-04-04 Thread Dean Long
On Wed, 3 Apr 2024 15:15:24 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See >> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around >> this change. >> >> Overall, making this an intrinsic improves overall performance

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v2]

2024-04-04 Thread Scott Gibbons
On Tue, 2 Apr 2024 08:09:44 GMT, Doug Simon wrote: > Wouldn't it be better to do this intrinsification directly in the JIT without > calling out to a stub? I believe the code size is too large for a direct JIT intrinsic. A lot of registers are also used, which may be an issue. -

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v2]

2024-04-04 Thread Scott Gibbons
On Tue, 2 Apr 2024 02:16:07 GMT, David Holmes wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Use non-sse fill (old left in) > > This looks like it is still a Draft/work-in-progress. There is only code for > x64

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v4]

2024-04-03 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64. See > [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around > this change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes.

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v3]

2024-04-02 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory`. See [this > PR](https://github.com/openjdk/jdk/pull/16760) for discussion around this > change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes. > > Tested

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v2]

2024-04-02 Thread ExE Boss
On Mon, 1 Apr 2024 21:30:19 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory`. See [this >> PR](https://github.com/openjdk/jdk/pull/16760) for discussion around this >> change. >> >> Overall, making this an intrinsic improves overall performance of >> `Un

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v2]

2024-04-02 Thread Doug Simon
On Mon, 1 Apr 2024 21:30:19 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory`. See [this >> PR](https://github.com/openjdk/jdk/pull/16760) for discussion around this >> change. >> >> Overall, making this an intrinsic improves overall performance of >> `Un

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v2]

2024-04-01 Thread David Holmes
On Mon, 1 Apr 2024 21:30:19 GMT, Scott Gibbons wrote: >> This code makes an intrinsic stub for `Unsafe::setMemory`. See [this >> PR](https://github.com/openjdk/jdk/pull/16760) for discussion around this >> change. >> >> Overall, making this an intrinsic improves overall performance of >> `Un

Re: RFR: 8329331: Intrinsify Unsafe::setMemory [v2]

2024-04-01 Thread Scott Gibbons
> This code makes an intrinsic stub for `Unsafe::setMemory`. See [this > PR](https://github.com/openjdk/jdk/pull/16760) for discussion around this > change. > > Overall, making this an intrinsic improves overall performance of > `Unsafe::setMemory` by up to 4x for all buffer sizes. > > Tested

RFR: 8329331: Intrinsify Unsafe::setMemory

2024-03-29 Thread Scott Gibbons
This code makes an intrinsic stub for `Unsafe::setMemory`. See [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around this change. Overall, making this an intrinsic improves overall performance of `Unsafe::setMemory` by up to 4x for all buffer sizes. Tested with tier-1 (an