Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v3]

2025-07-18 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 21:40:13 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Implement review feedback. Since the refactoring

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v3]

2025-07-18 Thread Joe Darcy
On Fri, 18 Jul 2025 13:40:15 GMT, Chen Liang wrote: > This array unrolling looks right to me. I'll write a regression test case to make sure. - PR Comment: https://git.openjdk.org/jdk/pull/26341#issuecomment-3090070661

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v3]

2025-07-18 Thread Chen Liang
On Thu, 17 Jul 2025 21:40:13 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Implement review feedback. This array unrolling l

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v3]

2025-07-18 Thread Raffaello Giulietti
On Thu, 17 Jul 2025 21:40:13 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Implement review feedback. Looks fine --

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v2]

2025-07-17 Thread Joe Darcy
On Thu, 17 Jul 2025 18:16:33 GMT, Chen Liang wrote: > I think local arrays require more structural changes to the code, which might > be why this patch did not include that change. However, note as said in > #26355, such conversions are meaningful and would potentially allow > performance boos

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v3]

2025-07-17 Thread Joe Darcy
> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Implement review feedback. - Changes: - all: https://git.openjdk.org/jdk/pull/26341/files - new

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-17 Thread Joe Darcy
On Thu, 17 Jul 2025 18:04:31 GMT, Raffaello Giulietti wrote: > The arrays at L.2257-2262 could be declared `static` and `@Stable` as well, > and moved outside the method. Right; those were the ones I was referring to when I wrote "Some small refactorings could be used to make a few non-static

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v2]

2025-07-17 Thread Chen Liang
On Thu, 17 Jul 2025 17:44:04 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Respond to review feedback and update copyright.

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v2]

2025-07-17 Thread Chen Liang
On Thu, 17 Jul 2025 17:44:04 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Respond to review feedback and update copyright.

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-17 Thread Raffaello Giulietti
On Wed, 16 Jul 2025 18:51:41 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > The methods directly affected by this update are atan, exp, and sin, cos, > tan. The sin, cos, and tan method are affected by the updates to > KernelRemPio2 and ta

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v2]

2025-07-17 Thread Joe Darcy
> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Respond to review feedback and update copyright. - Changes: - all: https://git.openjdk.org/jdk/pu

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-17 Thread Joe Darcy
On Thu, 17 Jul 2025 10:58:30 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/FdLibm.java line 815: >> >>> 813: */ >>> 814: >>> 815: private static final int init_jk[] = {2, 3, 4, 6}; // initial >>> value for jk >> >> Suggestion: >> >> @Stable private

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-17 Thread Shaojin Wen
On Thu, 17 Jul 2025 10:27:27 GMT, Raffaello Giulietti wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > src/java.base/share/classes/java/lang/FdLibm.java line 815: > >> 813: */ >> 814: >> 815: private static final int init_jk[] = {2, 3, 4,

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-17 Thread Shaojin Wen
On Wed, 16 Jul 2025 04:53:04 GMT, Joe Darcy wrote: > Add `@Stable` to the static final arrays used in the Java port of FDLIBM. src/java.base/share/classes/java/lang/FdLibm.java line 457: > 455: pio4 = 0x1.921fb54442d18p-1, // 7.85398163397448278999e-01 > 456: pio4lo=

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-17 Thread Raffaello Giulietti
On Wed, 16 Jul 2025 04:53:04 GMT, Joe Darcy wrote: > Add `@Stable` to the static final arrays used in the Java port of FDLIBM. The arrays at L.2257-2262 could be declared `static` and `@Stable` as well, and moved outside the method. src/java.base/share/classes/java/lang/FdLibm.java line 815:

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-16 Thread Joe Darcy
On Wed, 16 Jul 2025 04:53:04 GMT, Joe Darcy wrote: > Add `@Stable` to the static final arrays used in the Java port of FDLIBM. The methods directly affected by this update are atan, exp, and sin, cos, tan. The sin, cos, and tan method are affected by the updates to KernelRemPio2 and tan is als

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-16 Thread Joe Darcy
On Wed, 16 Jul 2025 18:32:13 GMT, John R Rose wrote: > The effect of this PR is to make the affected array elements eligible for > constant-folding by the JIT. > > The contract of `@Stable` is private to the JDK, since it is a trusted > annotation. The trusted user promises not to change the a

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-16 Thread John R Rose
On Wed, 16 Jul 2025 04:53:04 GMT, Joe Darcy wrote: > Add `@Stable` to the static final arrays used in the Java port of FDLIBM. The effect of this PR is to make the affected array elements eligible for constant-folding by the JIT. The contract of `@Stable` is private to the JDK, since it is a t

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-15 Thread Joe Darcy
On Wed, 16 Jul 2025 04:53:04 GMT, Joe Darcy wrote: > Add `@Stable` to the static final arrays used in the Java port of FDLIBM. Some small refactorings could be used to make a few non-static arrays static. - PR Comment: https://git.openjdk.org/jdk/pull/26341#issuecomment-3076738696

RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation

2025-07-15 Thread Joe Darcy
Add `@Stable` to the static final arrays used in the Java port of FDLIBM. - Commit messages: - JDK-8362376: Use @Stable annotation in Java FDLIBM implementation Changes: https://git.openjdk.org/jdk/pull/26341/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26341&range=00