From xgong at openjdk.org Fri Dec 1 01:16:15 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Fri, 1 Dec 2023 01:16:15 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: <9VeMdTAJPaPZDg9ZW7FVJOf9XGl4gGqAS-2g8SFc9c0=.36792cd5-66d9-4abc-ba0c-aee3478627f4@github.com> References: <9VeMdTAJPaPZDg9ZW7FVJOf9XGl4gGqAS-2g8SFc9c0=.36792cd5-66d9-4abc-ba0c-aee3478627f4@github.com> Message-ID: On Thu, 30 Nov 2023 11:13:14 GMT, Andrew Haley wrote: >> Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: >> >> Rename vmath to sleef in configure > > make/autoconf/lib-sleef.m4 line 56: > >> 54: AC_MSG_CHECKING([for the specified LIBSLEEF]) >> 55: if test -e ${with_libsleef}/lib/libsleef.so && >> 56: test -e ${with_libsleef}/include/sleef.h; then > > This fails on my system because libsleef is in `/usr/local/lib64/`. This is the correct place to look according to the Linux FHS. You should _not_ hard-code `/lib` Did you try to find the libsleef by passing `--with-libsleef=` ? Currently `--with-libsleef=` can only work for people manually built from sleef source code. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1411488447 From xgong at openjdk.org Fri Dec 1 01:22:15 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Fri, 1 Dec 2023 01:22:15 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: Message-ID: On Thu, 30 Nov 2023 20:13:06 GMT, Magnus Ihse Bursie wrote: > Not having a build time dependency on libsleef means you cannot really verify that the functions you want to call are correct, but maybe you feel secure that they will never change? I'm not sure. The main reason that we add such a wrapper library is to catch the sleef's ABI version changing earlier (i.e. at build time). So using .s code and not including sleef at built time can not match this requirement? ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1835248759 From xgong at openjdk.org Fri Dec 1 01:33:12 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Fri, 1 Dec 2023 01:33:12 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: Message-ID: On Thu, 30 Nov 2023 06:39:43 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: > > Rename vmath to sleef in configure > Okay, now I found a few more of your comments that I missed before. I apologize, the Github PR review UI can be a bit confusing when discussions are taking place in multiple locations. So, here's a revision to my list above: > > 1. An aach64 CPU can have both Neon and SVE present at the same time. > 2. You are assuming that Neon is always present, and what I referred to as the fallback case is in fact using Neon instead of SVE. > 3. You would like to split vect_math.c into two parts, e.g. vect_math_neon.c and vect_math_sve.c. > 4. You will then, use heuristics in hotspot to determine at runtime if SVE or Neon functionality should be used. Even if SVE is present on the runtime machine, heuristics can chose to use the Neon implementation anyway in some cases. > 5. Only vect_math_sve.c. need the -march+sve. Yes, all the above are true. > 6. The neon part do not need the -march+sve flag, and will fail if built with this flag. (???) Current neon code does not need the `-march=arm-a+sve` flag, but it will not fail if we built with it. Because the C compiler (GCC/Clang) can also supports SVE and NEON at the same time. My concert is that if we build the neon code with sve flags, it has the possibility that compiler may generate SVE specific instructions inside the NEON functions in future (e.g. if sve has new features related to method call) , although it doesn't happen now. If so, calling the neon stubs (which contains sve instructions) on non-sve supported machines in runtime may crash. Hence, it's more safe if we can separate neon and sve code and use different flags for them. > Anyway, it is straightforward to add compiler flags to individual files. You do it like this: > > $(eval $(call SetupJdkLibrary, BUILD_LIBVMATH, \ NAME := vmath, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBSLEEF_CFLAGS) -fvisibility=default, \ vect_math_sve.c_CFLAGS := $(SVE_CFLAGS), \ ... Thanks so much for this. That's very helpful! ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1835258683 From xgong at openjdk.org Fri Dec 1 08:48:52 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Fri, 1 Dec 2023 08:48:52 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: > Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). > > SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. > > To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. > > Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. > > [1] https://github.com/openjdk/jdk/pull/3638 > [2] https://sleef.org/ > [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ > [4] https://packages.debian.org/bookworm/libsleef3 > [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: - Separate neon and sve functions into two source files - Merge branch 'jdk:master' into JDK-8312425 - Rename vmath to sleef in configure - Address review comments in build system - Add a bundled native lib in jdk as a bridge to libsleef - Merge 'jdk:master' into JDK-8312425 - Disable sleef by default - Merge 'jdk:master' into JDK-8312425 - 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16234/files - new: https://git.openjdk.org/jdk/pull/16234/files/c1ce1968..ee5caf6d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16234&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16234&range=04-05 Stats: 638331 lines in 1866 files changed: 100400 ins; 474467 del; 63464 mod Patch: https://git.openjdk.org/jdk/pull/16234.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16234/head:pull/16234 PR: https://git.openjdk.org/jdk/pull/16234 From alanb at openjdk.org Fri Dec 1 08:57:05 2023 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 1 Dec 2023 08:57:05 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v4] In-Reply-To: References: Message-ID: On Thu, 30 Nov 2023 23:49:24 GMT, Joe Darcy wrote: >> Time to start making preparations for JDK 23. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update symbol files to JDK 22 b26. Good good. I assume you'll bump the copyright header on the files that need it before integration, e.g. JavacTestingAbstractProcessor. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16505#pullrequestreview-1759306298 From aph at openjdk.org Fri Dec 1 10:00:14 2023 From: aph at openjdk.org (Andrew Haley) Date: Fri, 1 Dec 2023 10:00:14 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: <8SBUvWGDLtQmwYPRBDeUkeuq4pf2nJfKfDY5rzZODFU=.3f1cc0ff-02e6-4a4e-9425-5ffccc9cbc8f@github.com> Message-ID: On Thu, 30 Nov 2023 14:50:24 GMT, Andrew Haley wrote: >> Do this, but with the name vect_math.S. Don't use SLEEF headers in the build. I think you can do this with no build-time dependency on SLEEF at all if you load the library lazily at runtime. >> >> [vect_math.S.txt](https://github.com/openjdk/jdk/files/13512306/vect_math.S.txt) > >> [vect_math.S.txt](https://github.com/openjdk/jdk/files/13512306/vect_math.S.txt) > > I guess this will live only in os_linux and os_bsd because the Windows compiler won't like it AFAIK. > @theRealAph So your suggestion is that this assembly files lives in hotspot, instead of jdk.incubator.vector? I don't think it much matters, because these functions will only be available to HotSpot. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1835801386 From aph at openjdk.org Fri Dec 1 10:05:19 2023 From: aph at openjdk.org (Andrew Haley) Date: Fri, 1 Dec 2023 10:05:19 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: Message-ID: On Fri, 1 Dec 2023 01:19:12 GMT, Xiaohong Gong wrote: > > Not having a build time dependency on libsleef means you cannot really verify that the functions you want to call are correct, but maybe you feel secure that they will never change? > > I'm not sure. The main reason that we add such a wrapper library is to catch the sleef's ABI version changing earlier (i.e. at build time). So using .s code and not including sleef at built time can not match this requirement? I don't know what this means. If we're using an external SLEEF, then we can't catch ABI versions changes at build time. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1835805290 From aph at openjdk.org Fri Dec 1 10:05:23 2023 From: aph at openjdk.org (Andrew Haley) Date: Fri, 1 Dec 2023 10:05:23 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: <9VeMdTAJPaPZDg9ZW7FVJOf9XGl4gGqAS-2g8SFc9c0=.36792cd5-66d9-4abc-ba0c-aee3478627f4@github.com> Message-ID: On Fri, 1 Dec 2023 01:13:37 GMT, Xiaohong Gong wrote: >> make/autoconf/lib-sleef.m4 line 56: >> >>> 54: AC_MSG_CHECKING([for the specified LIBSLEEF]) >>> 55: if test -e ${with_libsleef}/lib/libsleef.so && >>> 56: test -e ${with_libsleef}/include/sleef.h; then >> >> This fails on my system because libsleef is in `/usr/local/lib64/`. This is the correct place to look according to the Linux FHS. You should _not_ hard-code `/lib` > > Did you try to find the libsleef by passing `--with-libsleef=` ? Currently `--with-libsleef=` can only work for people manually built from sleef source code. Yes. It still failed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1411877145 From aph at openjdk.org Fri Dec 1 10:08:11 2023 From: aph at openjdk.org (Andrew Haley) Date: Fri, 1 Dec 2023 10:08:11 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: Message-ID: On Fri, 1 Dec 2023 09:59:58 GMT, Andrew Haley wrote: > Not having a build time dependency on libsleef means you cannot really verify that the functions you want to call are correct, but maybe you feel secure that they will never change? We can still have SLEEF tests, but they will require a SLEEF library to be there. We can't control what is present at runtime, though. What are you trying to verify? ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1835812963 From aph at openjdk.org Fri Dec 1 10:19:16 2023 From: aph at openjdk.org (Andrew Haley) Date: Fri, 1 Dec 2023 10:19:16 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: On Fri, 1 Dec 2023 08:48:52 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: > > - Separate neon and sve functions into two source files > - Merge branch 'jdk:master' into JDK-8312425 > - Rename vmath to sleef in configure > - Address review comments in build system > - Add a bundled native lib in jdk as a bridge to libsleef > - Merge 'jdk:master' into JDK-8312425 > - Disable sleef by default > - Merge 'jdk:master' into JDK-8312425 > - 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF Let me summarize the issues, as I see them: To a high-order approximation, no one builds their own JDK. We want people to be able to use these vector math operations. There is no need to depend on a specific SLEEF library version. I do not expect SLEEF to break the ABI by e.g. renaming functions. (I know, but let's assume.) As long as the functions we want to use are present, we should use them. SLEEF is not (yet) a standard part of OSs and build systems. We don't want to fail unnecessarily at runtime because of a SLEEF ABI version change. We don't want to fail to build the JDK if our GCC is too old for SVE. (Is that a problem now? It might be.) We want to be able to test and run with any version of SLEEF, as long as the functions we need are present. It should be possible to drop a SLEEF library into the system, and the JDK will use it. The alternative is to package SLEEF with the JDK. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1835829658 From aph at openjdk.org Fri Dec 1 10:22:21 2023 From: aph at openjdk.org (Andrew Haley) Date: Fri, 1 Dec 2023 10:22:21 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: <3cK9QjVQNIgZoWWhrWKEb3XxfbLjprjRMBbStWegH7M=.6df92651-b97d-445a-aa42-302ea791bbea@github.com> On Fri, 1 Dec 2023 08:48:52 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: > > - Separate neon and sve functions into two source files > - Merge branch 'jdk:master' into JDK-8312425 > - Rename vmath to sleef in configure > - Address review comments in build system > - Add a bundled native lib in jdk as a bridge to libsleef > - Merge 'jdk:master' into JDK-8312425 > - Disable sleef by default > - Merge 'jdk:master' into JDK-8312425 > - 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF Oh, and: If we can't trust SLEEF not to break the ABI we're using, we should not be using SLEEF. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1835833150 From clanger at openjdk.org Fri Dec 1 12:45:10 2023 From: clanger at openjdk.org (Christoph Langer) Date: Fri, 1 Dec 2023 12:45:10 GMT Subject: RFR: 8320931: [REDO] dsymutil command leaves around temporary directories [v2] In-Reply-To: References: Message-ID: On Thu, 30 Nov 2023 09:39:54 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change will attempts to workaround an issue in dsymutil? >> >> The previous attempt to use `--reproducer Off` has shown that it fails to build on some other Xcode versions other than 14.3.1. Users have reported it to fail on Xcode 15.0.1 and Xcode from a 12.4 devkit. The `--reproducer` option isn't being recognized on those versions. >> >> This current PR proposes to use an alternate workaround, one which just sets an environment variable that Xcode 14.3.1 recognizes and prevents the creation of the leftover `dsymutil-*` temporary directories. Since this new approach uses an environment variable to workaround the issue, the command itself shouldn't ideally run into any usage issues. Once we agree upon this change, before integrating, I'll ask for inputs from those who had run into build issues to verify this alternate approach doesn't cause problems. >> >> I have locally verified that this new approach continues to work and doesn't create those temporary directories. Additionally tier1, tier2, tier3 has completed successfully in our CI environment with this change. >> >> Magnus, Erik, I looked around to see if there's any convention in setting such environment variables that will be used when invoking external tools during the build. I didn't find any similar usage. Although the current change in this PR is working, if there's a different and better way to do this, please do let me know. > > Jaikiran Pai has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - check for the support of --reproducer option before using it for dsymutil > - merge latest from master branch > - 8320931: [REDO] dsymutil command leaves around temporary directories Looks good, passes SAP's build setup. ------------- Marked as reviewed by clanger (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16876#pullrequestreview-1759737397 From jpai at openjdk.org Fri Dec 1 12:45:10 2023 From: jpai at openjdk.org (Jaikiran Pai) Date: Fri, 1 Dec 2023 12:45:10 GMT Subject: RFR: 8320931: [REDO] dsymutil command leaves around temporary directories [v2] In-Reply-To: References: Message-ID: On Thu, 30 Nov 2023 09:39:54 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change will attempts to workaround an issue in dsymutil? >> >> The previous attempt to use `--reproducer Off` has shown that it fails to build on some other Xcode versions other than 14.3.1. Users have reported it to fail on Xcode 15.0.1 and Xcode from a 12.4 devkit. The `--reproducer` option isn't being recognized on those versions. >> >> This current PR proposes to use an alternate workaround, one which just sets an environment variable that Xcode 14.3.1 recognizes and prevents the creation of the leftover `dsymutil-*` temporary directories. Since this new approach uses an environment variable to workaround the issue, the command itself shouldn't ideally run into any usage issues. Once we agree upon this change, before integrating, I'll ask for inputs from those who had run into build issues to verify this alternate approach doesn't cause problems. >> >> I have locally verified that this new approach continues to work and doesn't create those temporary directories. Additionally tier1, tier2, tier3 has completed successfully in our CI environment with this change. >> >> Magnus, Erik, I looked around to see if there's any convention in setting such environment variables that will be used when invoking external tools during the build. I didn't find any similar usage. Although the current change in this PR is working, if there's a different and better way to do this, please do let me know. > > Jaikiran Pai has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - check for the support of --reproducer option before using it for dsymutil > - merge latest from master branch > - 8320931: [REDO] dsymutil command leaves around temporary directories Thank you Christoph for running the tests. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16876#issuecomment-1836058345 From asotona at openjdk.org Fri Dec 1 13:18:30 2023 From: asotona at openjdk.org (Adam Sotona) Date: Fri, 1 Dec 2023 13:18:30 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v32] In-Reply-To: References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> <9-Fm-UXpDT0FLAxTw9xve00qurpqv01xw1uJwG0IXKQ=.06a9e0da-7a8c-462b-9b7a-b1be1b9bff5f@github.com> <8aNWssZUAmka3xQNMbRvY8P8ruJ0-7Eo5NTLeQGPko4=.ac8f1a19-8f0a-42fc-85cf-2fb540d194a7@github.com> Message-ID: On Wed, 29 Nov 2023 08:46:46 GMT, Per Minborg wrote: >> This is explicit list of supported class file versions, so I don't see any other way. > > Would it not be possible to expose an immutable `Map` that maps from Java version to major class version? This is actually out of scope of this PR. Feel free to request a new ClassFile API feature. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15706#discussion_r1412090733 From asotona at openjdk.org Fri Dec 1 13:46:25 2023 From: asotona at openjdk.org (Adam Sotona) Date: Fri, 1 Dec 2023 13:46:25 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v33] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > Thanks, > Adam Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 371 commits: - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java - fixed SwitchBootstrapTest - fixed SwitchBootstrap and StackMapsTest - fixed SwtichBootstrapTest and ModuleVersionTest - Merge branch 'master' into JDK-8308753-preview - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/jdk/jdk/classfile/StackMapsTest.java - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/langtools/tools/javac/7199823/InnerClassCannotBeVerified.java - added new package-info snippets and fixed ClassFile::parse throws javadoc description - fixed lambda tests - Merge branch 'master' into JDK-8308753-preview - ... and 361 more: https://git.openjdk.org/jdk/compare/3b30095a...b7b2e4e4 ------------- Changes: https://git.openjdk.org/jdk/pull/15706/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=32 Stats: 32362 lines in 787 files changed: 14660 ins; 14113 del; 3589 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From ihse at openjdk.org Fri Dec 1 15:04:19 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 1 Dec 2023 15:04:19 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: <3cK9QjVQNIgZoWWhrWKEb3XxfbLjprjRMBbStWegH7M=.6df92651-b97d-445a-aa42-302ea791bbea@github.com> References: <3cK9QjVQNIgZoWWhrWKEb3XxfbLjprjRMBbStWegH7M=.6df92651-b97d-445a-aa42-302ea791bbea@github.com> Message-ID: On Fri, 1 Dec 2023 10:19:01 GMT, Andrew Haley wrote: >> Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: >> >> - Separate neon and sve functions into two source files >> - Merge branch 'jdk:master' into JDK-8312425 >> - Rename vmath to sleef in configure >> - Address review comments in build system >> - Add a bundled native lib in jdk as a bridge to libsleef >> - Merge 'jdk:master' into JDK-8312425 >> - Disable sleef by default >> - Merge 'jdk:master' into JDK-8312425 >> - 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF > > Oh, and: > > If we can't trust SLEEF not to break the ABI we're using, we should not be using SLEEF. @theRealAph You are making good points. You are basically saying: "we don't need any configure support for libsleef, we can just hard-code the names and dispatch to them directly to a dlopened library at runtime". That is technically correct, but I'd still like to argue that the current setup have some merits: * It will check that there is no typo in the function names. I agree that the likelihood of getting this wrong is low, but it is still a good practice to use official include files to have the compiler help checking this. * If we would like to bundle libsleef.so with the JVM, now we have the possibility do do so easily. (Especially if it is like you say that it is not commonly installed). (If licenses allow etc) * If we want to incorporate/bundle the source code of libsleef into OpenJDK, and build it as part of our internal library, we will have a good starting position, compared to starting from a hard-coded assembly file in hotspot. (I thought I heard some noise about this prospect). So at this point, I am okay with the general approach of this PR. There are still some build issues to sort out, though, I'll address them separately. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1836266314 From ihse at openjdk.org Fri Dec 1 16:29:18 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 1 Dec 2023 16:29:18 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: On Fri, 1 Dec 2023 08:48:52 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: > > - Separate neon and sve functions into two source files > - Merge branch 'jdk:master' into JDK-8312425 > - Rename vmath to sleef in configure > - Address review comments in build system > - Add a bundled native lib in jdk as a bridge to libsleef > - Merge 'jdk:master' into JDK-8312425 > - Disable sleef by default > - Merge 'jdk:master' into JDK-8312425 > - 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF doc/building.md line 639: > 637: > 638: libsleef, the [SIMD Library for Evaluating Elementary Functions]( > 639: https://sleef.org/) is required when building libvmath.so on Linux/aarch64 This is incorrect. The library is not required, but if it is present, we will build libvmath with it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1412330808 From ihse at openjdk.org Fri Dec 1 16:39:14 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 1 Dec 2023 16:39:14 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: <9VeMdTAJPaPZDg9ZW7FVJOf9XGl4gGqAS-2g8SFc9c0=.36792cd5-66d9-4abc-ba0c-aee3478627f4@github.com> Message-ID: On Fri, 1 Dec 2023 10:02:35 GMT, Andrew Haley wrote: >> Did you try to find the libsleef by passing `--with-libsleef=` ? Currently `--with-libsleef=` can only work for people manually built from sleef source code. > > Yes. It still failed. You need to expand this logic to cover more instances. See e.g. lib-ffi.m4 for inspiration. Basic flow: * if user has specified libsleef root with argument, check both lib/ and lib64/ under that root. * if user has not specified libsleef root, and we have no SYSROOT, try PKG_CHECK * Otherwise, look in well-known directories which is $SYSROOT/usr/[local/]lib[64]. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1412340745 From ihse at openjdk.org Fri Dec 1 16:39:15 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 1 Dec 2023 16:39:15 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: <9VeMdTAJPaPZDg9ZW7FVJOf9XGl4gGqAS-2g8SFc9c0=.36792cd5-66d9-4abc-ba0c-aee3478627f4@github.com> Message-ID: On Fri, 1 Dec 2023 16:35:31 GMT, Magnus Ihse Bursie wrote: >> Yes. It still failed. > > You need to expand this logic to cover more instances. See e.g. lib-ffi.m4 for inspiration. > > Basic flow: > * if user has specified libsleef root with argument, check both lib/ and lib64/ under that root. > * if user has not specified libsleef root, and we have no SYSROOT, try PKG_CHECK > * Otherwise, look in well-known directories which is $SYSROOT/usr/[local/]lib[64]. also, ideally, you will add the corresponding specific overrides like in ffi: AC_ARG_WITH(libffi-include, [AS_HELP_STRING([--with-libffi-include], [specify directory for the libffi include files])]) AC_ARG_WITH(libffi-lib, [AS_HELP_STRING([--with-libffi-lib], [specify directory for the libffi library])]) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1412341451 From ihse at openjdk.org Fri Dec 1 16:48:17 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 1 Dec 2023 16:48:17 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: On Fri, 1 Dec 2023 08:48:52 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: > > - Separate neon and sve functions into two source files > - Merge branch 'jdk:master' into JDK-8312425 > - Rename vmath to sleef in configure > - Address review comments in build system > - Add a bundled native lib in jdk as a bridge to libsleef > - Merge 'jdk:master' into JDK-8312425 > - Disable sleef by default > - Merge 'jdk:master' into JDK-8312425 > - 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF The final thing we need to resolve properly is the SVE compiler test. @theRealAph says: > arm_sve.h is part of GCC. It was added to GCC in 2019. A more relevant question is what version of gcc it was added, and if that also implies that the compiler knows about `-march=armv8-a+sve`. If so, then this test could basically be framed as a gcc version check. I'm still leaning towards failing configure if the SVE code cannot be compiled. Under what circumstances can this test possibly fail, so SVE_CFLAGS would not be set? ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1836444674 From aph at openjdk.org Fri Dec 1 16:52:14 2023 From: aph at openjdk.org (Andrew Haley) Date: Fri, 1 Dec 2023 16:52:14 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: <3cK9QjVQNIgZoWWhrWKEb3XxfbLjprjRMBbStWegH7M=.6df92651-b97d-445a-aa42-302ea791bbea@github.com> References: <3cK9QjVQNIgZoWWhrWKEb3XxfbLjprjRMBbStWegH7M=.6df92651-b97d-445a-aa42-302ea791bbea@github.com> Message-ID: On Fri, 1 Dec 2023 10:19:01 GMT, Andrew Haley wrote: >> Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: >> >> - Separate neon and sve functions into two source files >> - Merge branch 'jdk:master' into JDK-8312425 >> - Rename vmath to sleef in configure >> - Address review comments in build system >> - Add a bundled native lib in jdk as a bridge to libsleef >> - Merge 'jdk:master' into JDK-8312425 >> - Disable sleef by default >> - Merge 'jdk:master' into JDK-8312425 >> - 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF > > Oh, and: > > If we can't trust SLEEF not to break the ABI we're using, we should not be using SLEEF. > @theRealAph You are making good points. > > You are basically saying: "we don't need any configure support for libsleef, we can just hard-code the names and dispatch to them directly to a dlopened library at runtime". Yep. > That is technically correct, but I'd still like to argue that the current setup have some merits: > > * It will check that there is no typo in the function names. I agree that the likelihood of getting this wrong is low, but it is still a good practice to use official include files to have the compiler help checking this. > > * If we would like to bundle libsleef.so with the JVM, now we have the possibility do do so easily. (Especially if it is like you say that it is not commonly installed). (If licenses allow etc) > > * If we want to incorporate/bundle the source code of libsleef into OpenJDK, and build it as part of our internal library, we will have a good starting position, compared to starting from a hard-coded assembly file in hotspot. (I thought I heard some noise about this prospect). > > > So at this point, I am okay with the general approach of this PR. There are still some build issues to sort out, though, I'll address them separately. I see, OK. The question in my mind is whether the common builds of OpenJDK (Oracle, Adoptium, etc.) will support running with SLEEF. If by default SLEEF is not required, support won't be built, and (to an nth order approximation) no one will use it. But I guess it's better than nothing. Or is there likely to be a plan to e.g. build Oracle's releases with SLEEF support? ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1836449876 From ihse at openjdk.org Fri Dec 1 17:03:10 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 1 Dec 2023 17:03:10 GMT Subject: RFR: 8320931: [REDO] dsymutil command leaves around temporary directories [v2] In-Reply-To: References: Message-ID: On Thu, 30 Nov 2023 09:39:54 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change will attempts to workaround an issue in dsymutil? >> >> The previous attempt to use `--reproducer Off` has shown that it fails to build on some other Xcode versions other than 14.3.1. Users have reported it to fail on Xcode 15.0.1 and Xcode from a 12.4 devkit. The `--reproducer` option isn't being recognized on those versions. >> >> This current PR proposes to use an alternate workaround, one which just sets an environment variable that Xcode 14.3.1 recognizes and prevents the creation of the leftover `dsymutil-*` temporary directories. Since this new approach uses an environment variable to workaround the issue, the command itself shouldn't ideally run into any usage issues. Once we agree upon this change, before integrating, I'll ask for inputs from those who had run into build issues to verify this alternate approach doesn't cause problems. >> >> I have locally verified that this new approach continues to work and doesn't create those temporary directories. Additionally tier1, tier2, tier3 has completed successfully in our CI environment with this change. >> >> Magnus, Erik, I looked around to see if there's any convention in setting such environment variables that will be used when invoking external tools during the build. I didn't find any similar usage. Although the current change in this PR is working, if there's a different and better way to do this, please do let me know. > > Jaikiran Pai has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - check for the support of --reproducer option before using it for dsymutil > - merge latest from master branch > - 8320931: [REDO] dsymutil command leaves around temporary directories I have now tested this with Xcode 15.0 as well and confirm that it works. I think this means that you can safely integrate now. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16876#issuecomment-1836464615 From vromero at openjdk.org Fri Dec 1 18:34:05 2023 From: vromero at openjdk.org (Vicente Romero) Date: Fri, 1 Dec 2023 18:34:05 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v4] In-Reply-To: References: Message-ID: On Thu, 30 Nov 2023 23:49:24 GMT, Joe Darcy wrote: >> Time to start making preparations for JDK 23. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update symbol files to JDK 22 b26. looks good to me ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16505#pullrequestreview-1760367216 From jpai at openjdk.org Sat Dec 2 05:41:45 2023 From: jpai at openjdk.org (Jaikiran Pai) Date: Sat, 2 Dec 2023 05:41:45 GMT Subject: RFR: 8320931: [REDO] dsymutil command leaves around temporary directories [v2] In-Reply-To: References: Message-ID: On Thu, 30 Nov 2023 09:39:54 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change will attempts to workaround an issue in dsymutil? >> >> The previous attempt to use `--reproducer Off` has shown that it fails to build on some other Xcode versions other than 14.3.1. Users have reported it to fail on Xcode 15.0.1 and Xcode from a 12.4 devkit. The `--reproducer` option isn't being recognized on those versions. >> >> This current PR proposes to use an alternate workaround, one which just sets an environment variable that Xcode 14.3.1 recognizes and prevents the creation of the leftover `dsymutil-*` temporary directories. Since this new approach uses an environment variable to workaround the issue, the command itself shouldn't ideally run into any usage issues. Once we agree upon this change, before integrating, I'll ask for inputs from those who had run into build issues to verify this alternate approach doesn't cause problems. >> >> I have locally verified that this new approach continues to work and doesn't create those temporary directories. Additionally tier1, tier2, tier3 has completed successfully in our CI environment with this change. >> >> Magnus, Erik, I looked around to see if there's any convention in setting such environment variables that will be used when invoking external tools during the build. I didn't find any similar usage. Although the current change in this PR is working, if there's a different and better way to do this, please do let me know. > > Jaikiran Pai has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - check for the support of --reproducer option before using it for dsymutil > - merge latest from master branch > - 8320931: [REDO] dsymutil command leaves around temporary directories Thank you Magnus and others for helping review and test this change. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16876#issuecomment-1837049715 From jpai at openjdk.org Sat Dec 2 05:41:45 2023 From: jpai at openjdk.org (Jaikiran Pai) Date: Sat, 2 Dec 2023 05:41:45 GMT Subject: Integrated: 8320931: [REDO] dsymutil command leaves around temporary directories In-Reply-To: References: Message-ID: On Wed, 29 Nov 2023 06:45:17 GMT, Jaikiran Pai wrote: > Can I please get a review of this change will attempts to workaround an issue in dsymutil? > > The previous attempt to use `--reproducer Off` has shown that it fails to build on some other Xcode versions other than 14.3.1. Users have reported it to fail on Xcode 15.0.1 and Xcode from a 12.4 devkit. The `--reproducer` option isn't being recognized on those versions. > > This current PR proposes to use an alternate workaround, one which just sets an environment variable that Xcode 14.3.1 recognizes and prevents the creation of the leftover `dsymutil-*` temporary directories. Since this new approach uses an environment variable to workaround the issue, the command itself shouldn't ideally run into any usage issues. Once we agree upon this change, before integrating, I'll ask for inputs from those who had run into build issues to verify this alternate approach doesn't cause problems. > > I have locally verified that this new approach continues to work and doesn't create those temporary directories. Additionally tier1, tier2, tier3 has completed successfully in our CI environment with this change. > > Magnus, Erik, I looked around to see if there's any convention in setting such environment variables that will be used when invoking external tools during the build. I didn't find any similar usage. Although the current change in this PR is working, if there's a different and better way to do this, please do let me know. This pull request has now been integrated. Changeset: 6f7bb79a Author: Jaikiran Pai URL: https://git.openjdk.org/jdk/commit/6f7bb79a5b543ebd9ccd72d7b1b289b1f6e4cedb Stats: 11 lines in 1 file changed: 11 ins; 0 del; 0 mod 8320931: [REDO] dsymutil command leaves around temporary directories Reviewed-by: ihse, clanger ------------- PR: https://git.openjdk.org/jdk/pull/16876 From mgronlun at openjdk.org Sat Dec 2 11:33:53 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sat, 2 Dec 2023 11:33:53 GMT Subject: RFR: 8211238: @Deprecated JFR event Message-ID: Greetings, please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. Testing: jdk_jfr, CI 1-6, stress testing Thanks Markus ------------- Commit messages: - Merge branch 'openjdk:master' into 8211238 - whitespace - emergency dump support - whitespace - remove assert - 8211238 Changes: https://git.openjdk.org/jdk/pull/16931/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8211238 Stats: 2391 lines in 65 files changed: 2043 ins; 251 del; 97 mod Patch: https://git.openjdk.org/jdk/pull/16931.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16931/head:pull/16931 PR: https://git.openjdk.org/jdk/pull/16931 From mgronlun at openjdk.org Sat Dec 2 17:20:58 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sat, 2 Dec 2023 17:20:58 GMT Subject: RFR: 8211238: @Deprecated JFR event [v2] In-Reply-To: References: Message-ID: > Greetings, > > please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. > > Testing: jdk_jfr, CI 1-6, stress testing > > Thanks > Markus Markus Gr?nlund has updated the pull request incrementally with two additional commits since the last revision: - Merge branch '8211238' of github.com:mgronlun/jdk into 8211238 - reflection support ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16931/files - new: https://git.openjdk.org/jdk/pull/16931/files/cdedbb20..1d0b8a98 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=00-01 Stats: 131 lines in 5 files changed: 120 ins; 9 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/16931.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16931/head:pull/16931 PR: https://git.openjdk.org/jdk/pull/16931 From darcy at openjdk.org Sat Dec 2 20:34:36 2023 From: darcy at openjdk.org (Joe Darcy) Date: Sat, 2 Dec 2023 20:34:36 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v4] In-Reply-To: References: Message-ID: On Fri, 1 Dec 2023 08:54:06 GMT, Alan Bateman wrote: > Looks good. I assume you'll bump the copyright header on the files that need it before integration, e.g. JavacTestingAbstractProcessor. Right; I run a script to update the years of modified files. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16505#issuecomment-1837247101 From aturbanov at openjdk.org Sat Dec 2 20:43:39 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Sat, 2 Dec 2023 20:43:39 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v4] In-Reply-To: References: Message-ID: <8B_EG0mwCKb3mRlrAoyz7vkzZhNPpZUAfY-EOQ1FlEo=.efbc5ce9-1a75-4aa2-8dfc-96a9c9fd03b7@github.com> On Thu, 30 Nov 2023 23:49:24 GMT, Joe Darcy wrote: >> Time to start making preparations for JDK 23. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update symbol files to JDK 22 b26. test/langtools/tools/javac/versions/Versions.java line 97: > 95: TWENTY_ONE(false,"65.0", "21"), > 96: TWENTY_TWO(false,"66.0", "22"), > 97: TWENTY_THREE(false,"67.0", "23"), As alignment is broken anyway, let's add space Suggestion: TWENTY_THREE(false, "67.0", "23"), ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16505#discussion_r1412868557 From duke at openjdk.org Sat Dec 2 22:10:37 2023 From: duke at openjdk.org (serge-sans-paille) Date: Sat, 2 Dec 2023 22:10:37 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v6] In-Reply-To: <-lVL7hp68aKNlBWHCxdKdPrPDe6NOAKD3zoX-u5ZMEM=.6164666f-7312-4f0c-b15b-2e01a331e820@github.com> References: <-lVL7hp68aKNlBWHCxdKdPrPDe6NOAKD3zoX-u5ZMEM=.6164666f-7312-4f0c-b15b-2e01a331e820@github.com> Message-ID: On Wed, 29 Nov 2023 06:12:54 GMT, David Holmes wrote: >> Not listed here: https://oca.opensource.oracle.com/?ojr=contributors > > I take it he is not an Intel employee, in which case he has to be an OpenJDK contributor himself for code for which he holds a copyright to be contributed to OpenJDK. @robilad please correct me if I am wrong here. hey o/ No problem on my side to either let go my copyright or fill the contributor agreement (where is it?) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1409280698 From robilad at openjdk.org Sat Dec 2 22:10:38 2023 From: robilad at openjdk.org (Dalibor Topic) Date: Sat, 2 Dec 2023 22:10:38 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v6] In-Reply-To: References: <-lVL7hp68aKNlBWHCxdKdPrPDe6NOAKD3zoX-u5ZMEM=.6164666f-7312-4f0c-b15b-2e01a331e820@github.com> Message-ID: <6gIzR7OWDjVSklcQD-PM7ng_maqv6IbhAjHfgm-hWEs=.45910411-ab20-4ef0-99fa-88a13f722b7b@github.com> On Wed, 29 Nov 2023 13:26:58 GMT, serge-sans-paille wrote: >> I take it he is not an Intel employee, in which case he has to be an OpenJDK contributor himself for code for which he holds a copyright to be contributed to OpenJDK. @robilad please correct me if I am wrong here. > > hey o/ No problem on my side to either let go my copyright or fill the contributor agreement (where is it?) Thanks Serge! And thank you for sending in an OCA for processing, which has now been done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1412885472 From alanb at openjdk.org Sun Dec 3 10:28:44 2023 From: alanb at openjdk.org (Alan Bateman) Date: Sun, 3 Dec 2023 10:28:44 GMT Subject: RFR: 8211238: @Deprecated JFR event [v2] In-Reply-To: References: Message-ID: On Sat, 2 Dec 2023 17:20:58 GMT, Markus Gr?nlund wrote: >> Greetings, >> >> please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. >> >> Testing: jdk_jfr, CI 1-6, stress testing >> >> Thanks >> Markus > > Markus Gr?nlund has updated the pull request incrementally with two additional commits since the last revision: > > - Merge branch '8211238' of github.com:mgronlun/jdk into 8211238 > - reflection support src/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedThing.java line 90: > 88: public static void reflectionForRemoval() { > 89: staticCounter++; > 90: } You might want to extend the set of tests to include cases that have the "since" element. There is a 2x2 matrix of cases to fully exercise the parsing of the RuntimeVisibleAnnotations content. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16931#discussion_r1413041171 From mgronlun at openjdk.org Sun Dec 3 13:29:21 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sun, 3 Dec 2023 13:29:21 GMT Subject: RFR: 8211238: @Deprecated JFR event [v3] In-Reply-To: References: Message-ID: > Greetings, > > please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. > > Testing: jdk_jfr, CI 1-6, stress testing > > Thanks > Markus Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: restructured testcase ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16931/files - new: https://git.openjdk.org/jdk/pull/16931/files/1d0b8a98..f8ef13cf Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=01-02 Stats: 279 lines in 4 files changed: 86 ins; 91 del; 102 mod Patch: https://git.openjdk.org/jdk/pull/16931.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16931/head:pull/16931 PR: https://git.openjdk.org/jdk/pull/16931 From mgronlun at openjdk.org Sun Dec 3 13:36:01 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sun, 3 Dec 2023 13:36:01 GMT Subject: RFR: 8211238: @Deprecated JFR event [v4] In-Reply-To: References: Message-ID: <848Z_qNEkLyfuHIDhH8zeM93fKdNQUk8IH9HNSX8R2g=.ecb41dae-630d-4515-9598-f642b93f4a0e@github.com> > Greetings, > > please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. > > Testing: jdk_jfr, CI 1-6, stress testing > > Thanks > Markus Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: whitespace ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16931/files - new: https://git.openjdk.org/jdk/pull/16931/files/f8ef13cf..2239ce2e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=02-03 Stats: 63 lines in 1 file changed: 0 ins; 0 del; 63 mod Patch: https://git.openjdk.org/jdk/pull/16931.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16931/head:pull/16931 PR: https://git.openjdk.org/jdk/pull/16931 From mgronlun at openjdk.org Sun Dec 3 13:36:05 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sun, 3 Dec 2023 13:36:05 GMT Subject: RFR: 8211238: @Deprecated JFR event [v2] In-Reply-To: References: Message-ID: On Sun, 3 Dec 2023 10:15:41 GMT, Alan Bateman wrote: >> Markus Gr?nlund has updated the pull request incrementally with two additional commits since the last revision: >> >> - Merge branch '8211238' of github.com:mgronlun/jdk into 8211238 >> - reflection support > > src/jdk.jfr/share/classes/jdk/jfr/internal/test/DeprecatedThing.java line 90: > >> 88: public static void reflectionForRemoval() { >> 89: staticCounter++; >> 90: } > > You might want to extend the set of tests to include cases that have the "since" element. There is a 2x2 matrix of cases to fully exercise the parsing of the RuntimeVisibleAnnotations content. Thanks for this input, Alan. I have made the tests and cases more structured to cover this. Cheers. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16931#discussion_r1413080638 From mgronlun at openjdk.org Sun Dec 3 15:44:57 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sun, 3 Dec 2023 15:44:57 GMT Subject: RFR: 8211238: @Deprecated JFR event [v5] In-Reply-To: References: Message-ID: <0WwjBlkrqLti-FWPfWAcPrLEdgDbJPLfc0f1FGBtZM8=.d760cb3b-81cb-45d5-b8c1-994a9e16413b@github.com> > Greetings, > > please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. > > Testing: jdk_jfr, CI 1-6, stress testing > > Thanks > Markus Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: tighter lock scopes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16931/files - new: https://git.openjdk.org/jdk/pull/16931/files/2239ce2e..a5717e16 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=03-04 Stats: 45 lines in 6 files changed: 16 ins; 13 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/16931.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16931/head:pull/16931 PR: https://git.openjdk.org/jdk/pull/16931 From mgronlun at openjdk.org Sun Dec 3 16:06:16 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sun, 3 Dec 2023 16:06:16 GMT Subject: RFR: 8211238: @Deprecated JFR event [v6] In-Reply-To: References: Message-ID: > Greetings, > > please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. > > Testing: jdk_jfr, CI 1-6, stress testing > > Thanks > Markus Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: tuning ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16931/files - new: https://git.openjdk.org/jdk/pull/16931/files/a5717e16..628651b3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=04-05 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/16931.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16931/head:pull/16931 PR: https://git.openjdk.org/jdk/pull/16931 From mgronlun at openjdk.org Sun Dec 3 16:13:19 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sun, 3 Dec 2023 16:13:19 GMT Subject: RFR: 8211238: @Deprecated JFR event [v7] In-Reply-To: References: Message-ID: > Greetings, > > please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. > > Testing: jdk_jfr, CI 1-6, stress testing > > Thanks > Markus Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: adjustements ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16931/files - new: https://git.openjdk.org/jdk/pull/16931/files/628651b3..5d76503f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=05-06 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/16931.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16931/head:pull/16931 PR: https://git.openjdk.org/jdk/pull/16931 From mgronlun at openjdk.org Sun Dec 3 16:31:13 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sun, 3 Dec 2023 16:31:13 GMT Subject: RFR: 8211238: @Deprecated JFR event [v8] In-Reply-To: References: Message-ID: > Greetings, > > please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. > > Testing: jdk_jfr, CI 1-6, stress testing > > Thanks > Markus Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: minor adjustment ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16931/files - new: https://git.openjdk.org/jdk/pull/16931/files/5d76503f..4e78e895 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=06-07 Stats: 2 lines in 1 file changed: 1 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/16931.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16931/head:pull/16931 PR: https://git.openjdk.org/jdk/pull/16931 From alanb at openjdk.org Sun Dec 3 16:36:40 2023 From: alanb at openjdk.org (Alan Bateman) Date: Sun, 3 Dec 2023 16:36:40 GMT Subject: RFR: 8211238: @Deprecated JFR event [v8] In-Reply-To: References: Message-ID: On Sun, 3 Dec 2023 16:31:13 GMT, Markus Gr?nlund wrote: >> Greetings, >> >> please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. >> >> Testing: jdk_jfr, CI 1-6, stress testing >> >> Thanks >> Markus > > Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: > > minor adjustment A question about "level". Is the intention that the value can be anything, e.g. some new event next month might use the values "1", "2, "3"? Just asking because ordinarily deprecated vs. terminally deprecated is very specific to the manner in which a program element is deprecated and I assume you don't want this event grabbing the general name for a very specific event setting. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16931#issuecomment-1837532534 From mgronlun at openjdk.org Sun Dec 3 16:47:38 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Sun, 3 Dec 2023 16:47:38 GMT Subject: RFR: 8211238: @Deprecated JFR event [v8] In-Reply-To: References: Message-ID: On Sun, 3 Dec 2023 16:33:48 GMT, Alan Bateman wrote: > A question about "level". Is the intention that the value can be anything, e.g. some new event next month might use the values "1", "2, "3"? Just asking because ordinarily deprecated vs. terminally deprecated is very specific to the manner in which a program element is deprecated and I assume you don't want this event grabbing the general name for a very specific event setting. Yes, the design is generic. An event control/setting to be used also for other events. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16931#issuecomment-1837534965 From dholmes at openjdk.org Mon Dec 4 03:20:38 2023 From: dholmes at openjdk.org (David Holmes) Date: Mon, 4 Dec 2023 03:20:38 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v6] In-Reply-To: References: <-lVL7hp68aKNlBWHCxdKdPrPDe6NOAKD3zoX-u5ZMEM=.6164666f-7312-4f0c-b15b-2e01a331e820@github.com> Message-ID: On Wed, 29 Nov 2023 13:26:58 GMT, serge-sans-paille wrote: >> I take it he is not an Intel employee, in which case he has to be an OpenJDK contributor himself for code for which he holds a copyright to be contributed to OpenJDK. @robilad please correct me if I am wrong here. > > hey o/ No problem on my side to either let go my copyright or fill the contributor agreement (where is it?) Thank you @serge-sans-paille ! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1413324819 From asotona at openjdk.org Mon Dec 4 05:38:48 2023 From: asotona at openjdk.org (Adam Sotona) Date: Mon, 4 Dec 2023 05:38:48 GMT Subject: RFR: 8308753: Class-File API transition to Preview [v34] In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > Thanks, > Adam Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 372 commits: - Merge branch 'master' into JDK-8308753-preview - Merge branch 'master' into JDK-8308753-preview # Conflicts: # src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java - fixed SwitchBootstrapTest - fixed SwitchBootstrap and StackMapsTest - fixed SwtichBootstrapTest and ModuleVersionTest - Merge branch 'master' into JDK-8308753-preview - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/jdk/jdk/classfile/StackMapsTest.java - Merge branch 'master' into JDK-8308753-preview # Conflicts: # test/langtools/tools/javac/7199823/InnerClassCannotBeVerified.java - added new package-info snippets and fixed ClassFile::parse throws javadoc description - fixed lambda tests - ... and 362 more: https://git.openjdk.org/jdk/compare/b9df827a...a908e805 ------------- Changes: https://git.openjdk.org/jdk/pull/15706/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15706&range=33 Stats: 32362 lines in 787 files changed: 14660 ins; 14113 del; 3589 mod Patch: https://git.openjdk.org/jdk/pull/15706.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15706/head:pull/15706 PR: https://git.openjdk.org/jdk/pull/15706 From asotona at openjdk.org Mon Dec 4 07:11:11 2023 From: asotona at openjdk.org (Adam Sotona) Date: Mon, 4 Dec 2023 07:11:11 GMT Subject: Integrated: 8308753: Class-File API transition to Preview In-Reply-To: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> References: <5IwVpRwPx8HQfqUqzhtpPP3yBUI3xvvzWHThG1OxYYA=.ea599d4e-5052-4c61-b12e-3ad6604fbb12@github.com> Message-ID: On Wed, 13 Sep 2023 09:48:00 GMT, Adam Sotona wrote: > Classfile API is an internal library under package `jdk.internal.classfile`?in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goes in sync with?[JDK-8308754](https://bugs.openjdk.org/browse/JDK-8308754): Class-File API (Preview) (CSR) > and?[JDK-8280389](https://bugs.openjdk.org/browse/JDK-8280389): Class-File API (Preview) (JEP). > > Online javadoc is available at:? > https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html > > In addition to the primary transition to preview, this pull request also includes: > - All?Classfile*?classes ranamed to?ClassFile*?(based on JEP discussion). > - A new preview feature, `CLASSFILE_API`, has been added. > - Buildsystem tool required a little patch to support annotated modules. > - All JDK modules using the Classfile API are newly participating in the preview. > - All tests that use the Classfile API now have preview enabled. > - A few Javac tests not allowing preview have been partially reverted; their conversion can be re-applied when the Classfile API leaves preview mode. > > Despite the number of affected files, this pull request is relatively straight-forward. The preview version of the Classfile API is based on the internal version of the library from the JDK master branch, and there are no API features added. > > Please review this pull request to help the Classfile API turn into a preview. > > Any comments are welcome. > > Thanks, > Adam This pull request has now been integrated. Changeset: 2b00ac0d Author: Adam Sotona URL: https://git.openjdk.org/jdk/commit/2b00ac0d02a110326846c75ea7ea535dccbb1924 Stats: 32362 lines in 787 files changed: 14660 ins; 14113 del; 3589 mod 8308753: Class-File API transition to Preview Reviewed-by: ihse, mchung, vromero ------------- PR: https://git.openjdk.org/jdk/pull/15706 From jlahoda at openjdk.org Mon Dec 4 07:50:57 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 4 Dec 2023 07:50:57 GMT Subject: RFR: 8321224: ct.sym for JDK 22 contains references to internal modules Message-ID: As part of: https://github.com/openjdk/jdk/pull/16505 there are new symbol files for JDK 22, and @jddarcy noted the content looks weird. I was investigating, and found a few problems, some introduced by https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, some pre-existing. Note that https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b changed the way we generate `ct.sym` - it now contains `.sig` files also for the current JDK, not only for the past versions. Before this patch, `ct.sym` only contained a list of permitted modules for the current JDK, and the classfiles themselves were read from `lib/modules`. The problems (and their solution) I've attempted to tackle here: - since https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, the ct.sym accidentally includes all modules for the current release, including non-API/undocumented modules. The proposed solution is to pass the documented modules together with their transitive dependencies as a parameter when constructing ct.sym, then use them to only generate data for these modules. - there are tiny differences between the data that are in `ct.sym` and in the `.sym.txt` historical files, mostly around annotations. The `.sym.txt` files contain references to internal annotations (like `@PreviewFeature`), which are stripped or converted before the `.sig` file is written into `ct.sym`. When generating historical data for JDK N, we run `CreateSymbols` on JDK N, reading the JDK N classfiles, and producing `.sym.txt`. This is done using `--release N`, so that we read the correct span of modules. Sadly, since now `--release N` will always use the `.sig` files, we are loosing a little bit of information esp. around the annotations. The proposal here is to use `--release N` to read the list of modules to cover, and `--source N` to read the actual real classfiles from `lib/modules`. This should basically revert the behavior to the previous state. - this is an existing issue, but one that needs to be fixed. Sealed types are not written and read properly - writing was not storing them, and reading permitted subclasses was happening too late, not on the `header` line. Note that when fixing this, we now must store some of the non-exported elements, which are reachable through the permitted subclasses, so that casting works as expected. Also, since the historical record is incorrect here, I re-run the generator for JDK 17-21 (as sealed classes where finalized in JDK 17), changes are included here, and are the bulk of the changes of this patch. - when trying to find an existing class header when processing a new class header, it might have happened that an older existing version was picked up. This then caused repetition of the header in the new version. Proposed fix is to first look at the baseline existing header when searching for existing headers, and also a bit more careful computation of baseline. As part of testing, I've written a simple program (inside tests), that prints all elements in exported packages using the `PrintingProcessor`, please see `PrintCTSymContent.java`. And printed the content for JDK 17-21 before this patch: https://cr.openjdk.org/~jlahoda/8321224/diff.00/orig/ after this patch: https://cr.openjdk.org/~jlahoda/8321224/diff.00/new/ and made a diff: https://cr.openjdk.org/~jlahoda/8321224/diff.00/diff/ Looking at the diff, it seems that (as expected) it is basically addition of `sealed`&`permits` and addition of package private classes (forced by `permits`). Symbol files generated for JDK 22 are here: https://github.com/lahodaj/jdk/commit/06606d544cb63f007b1d4eb5196f3ca6ffd24bed#diff-0029c8ea954c5b329126d760dc307cd3235abbe4e9f0530dc301141e33746d37 There's one quirk in the current historical record files: as the `jdk/internal/foreign/` package existed in the `jdk.incubator.foreign` module, and was moved to `java.base`, the generator still puts the classes in this package into `jdk.incubator.foreign-.sym.txt`. This is a quirk only in the way the `.sym.txt` files are written, when `ct.sym` is written, the `.sig` files are generated into the correct module. I may try to fix this for the future, but it does not seem to be blocker. (We need to include classes in this package due get the correct permitted subclasses handling.) ------------- Commit messages: - Removing trailing whitespace. - Ensuring qualified packages are recorded properly. - Fixing tests. - Adding a way to dump the API. - Adding missing file. - 8321224: ct.sym for JDK 22 contains references to internal modules Changes: https://git.openjdk.org/jdk/pull/16942/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16942&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8321224 Stats: 26876 lines in 194 files changed: 6106 ins; 20256 del; 514 mod Patch: https://git.openjdk.org/jdk/pull/16942.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16942/head:pull/16942 PR: https://git.openjdk.org/jdk/pull/16942 From darcy at openjdk.org Mon Dec 4 07:50:57 2023 From: darcy at openjdk.org (Joe Darcy) Date: Mon, 4 Dec 2023 07:50:57 GMT Subject: RFR: 8321224: ct.sym for JDK 22 contains references to internal modules In-Reply-To: References: Message-ID: On Sun, 3 Dec 2023 21:31:42 GMT, Jan Lahoda wrote: > As part of: > https://github.com/openjdk/jdk/pull/16505 > > there are new symbol files for JDK 22, and @jddarcy noted the content looks weird. > > I was investigating, and found a few problems, some introduced by https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, some pre-existing. > > Note that https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b changed the way we generate `ct.sym` - it now contains `.sig` files also for the current JDK, not only for the past versions. Before this patch, `ct.sym` only contained a list of permitted modules for the current JDK, and the classfiles themselves were read from `lib/modules`. > > The problems (and their solution) I've attempted to tackle here: > - since https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, the ct.sym accidentally includes all modules for the current release, including non-API/undocumented modules. The proposed solution is to pass the documented modules together with their transitive dependencies as a parameter when constructing ct.sym, then use them to only generate data for these modules. > - there are tiny differences between the data that are in `ct.sym` and in the `.sym.txt` historical files, mostly around annotations. The `.sym.txt` files contain references to internal annotations (like `@PreviewFeature`), which are stripped or converted before the `.sig` file is written into `ct.sym`. When generating historical data for JDK N, we run `CreateSymbols` on JDK N, reading the JDK N classfiles, and producing `.sym.txt`. This is done using `--release N`, so that we read the correct span of modules. Sadly, since now `--release N` will always use the `.sig` files, we are loosing a little bit of information esp. around the annotations. The proposal here is to use `--release N` to read the list of modules to cover, and `--source N` to read the actual real classfiles from `lib/modules`. This should basically revert the behavior to the previous state. > - this is an existing issue, but one that needs to be fixed. Sealed types are not written and read properly - writing was not storing them, and reading permitted subclasses was happening too late, not on the `header` line. Note that when fixing this, we now must store some of the non-exported elements, which are reachable through the permitted subclasses, so that casting works as expected. Also, since the historical record is incorrect here, I re-run the generator for JDK 17-21 (as sealed c... Marked as reviewed by darcy (Reviewer). Thanks for the quick fix @lahodaj ; the changes look plausible, but I think another person should review them too. We can coordinate with start-of-JDK-23 work depending on exactly when this change goes back. PS @lahodaj , I think a quick CSR is warranted here to explain the change in behavior in what is (now more correctly) stored in the symbol files. ------------- PR Review: https://git.openjdk.org/jdk/pull/16942#pullrequestreview-1761515541 PR Comment: https://git.openjdk.org/jdk/pull/16942#issuecomment-1837756730 PR Comment: https://git.openjdk.org/jdk/pull/16942#issuecomment-1837760204 From xgong at openjdk.org Mon Dec 4 08:33:49 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Mon, 4 Dec 2023 08:33:49 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: On Fri, 1 Dec 2023 16:45:49 GMT, Magnus Ihse Bursie wrote: > The final thing we need to resolve properly is the SVE compiler test. > > @theRealAph says: > > > arm_sve.h is part of GCC. It was added to GCC in 2019. > > A more relevant question is what version of gcc it was added, and if that also implies that the compiler knows about `-march=armv8-a+sve`. If so, then this test could basically be framed as a gcc version check. > > I'm still leaning towards failing configure if the SVE code cannot be compiled. Under what circumstances can this test possibly fail, so SVE_CFLAGS would not be set? Yes, the SVE compiler test code could be treated as a gcc/clang version check. `arm_sve.h` which is included in `sleef.h` and then in `vect_math_sve.c` is the SVE ACLE (Arm C Language Extensions) header file. It was included in gcc start from version 10 (may not be exact, but gcc 8/9 would fail when compile c code including this header). We have to make sure the compiler supports the SVE ACLE before using it. Here are the different scenarios: 1. The SVE compiler test success, and `SVE_CFLAGS` is set to `-march=armv8-a+sve`. All symbols in `libvmath.so` are built successfully including NEON/SVE. Hence, the vector math operations with all kinds of vector size on both NEON/SVE machines will be improved as expected. 2. The SVE compiler test fail, and `SVE_CFLAGS` is null. SVE symbols in `libvmath.so` cannot be built out. Only NEON symbols exist in `libvmath.so`. Hence, the enhancement for vector math operations with > 128-bit vector size on SVE machines are missing. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1838061502 From jwaters at openjdk.org Mon Dec 4 09:48:59 2023 From: jwaters at openjdk.org (Julian Waters) Date: Mon, 4 Dec 2023 09:48:59 GMT Subject: RFR: 8307160: Fix AWT/2D/A11Y to support the permissive- flag on the Microsoft Visual C compiler [v45] In-Reply-To: References: <7piLRto5nNbhYYYfENCr5ecm4M2xNtMkjkE8XhrLLQ0=.8fd1ac3a-46f8-47a8-ae37-a4abbf7757d9@github.com> Message-ID: On Mon, 4 Dec 2023 09:39:09 GMT, Julian Waters wrote: >> We should set the -permissive- flag for the Microsoft Visual C compiler, as was requested by the now backed out [JDK-8241499](https://bugs.openjdk.org/browse/JDK-8241499). Doing so makes the Visual C compiler much less accepting of ill formed code, which will improve code quality on Windows in the future. > > Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 78 commits: > > - Merge branch 'openjdk:master' into patch-10 > - Fix awt_Window.cpp > - Fix awt_PrintJob.cpp > - -Zc:stringStrings no longer needed with -permissive- flags-cflags.m4 > - Fix awt_Window.cpp > - awt_Window.cpp > - awt_PrintJob.cpp > - awt_Frame.cpp > - Whitespace awt_Component.cpp > - awt_Frame.cpp > - ... and 68 more: https://git.openjdk.org/jdk/compare/ed5b8c3a...fda1ab0f Re-adding build label since this now touches build flags again ------------- PR Comment: https://git.openjdk.org/jdk/pull/15096#issuecomment-1838179902 From mgronlun at openjdk.org Mon Dec 4 10:21:02 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Mon, 4 Dec 2023 10:21:02 GMT Subject: RFR: 8211238: @Deprecated JFR event [v9] In-Reply-To: References: Message-ID: > Greetings, > > please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK. > > Testing: jdk_jfr, CI 1-6, stress testing > > Thanks > Markus Markus Gr?nlund has updated the pull request incrementally with one additional commit since the last revision: relax assertion for native caller ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16931/files - new: https://git.openjdk.org/jdk/pull/16931/files/4e78e895..d67d2fcb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16931&range=07-08 Stats: 3 lines in 1 file changed: 0 ins; 3 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/16931.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16931/head:pull/16931 PR: https://git.openjdk.org/jdk/pull/16931 From jbachorik at openjdk.org Mon Dec 4 10:21:03 2023 From: jbachorik at openjdk.org (Jaroslav Bachorik) Date: Mon, 4 Dec 2023 10:21:03 GMT Subject: RFR: 8211238: @Deprecated JFR event [v8] In-Reply-To: References: Message-ID: On Sun, 3 Dec 2023 16:44:28 GMT, Markus Gr?nlund wrote: >> A question about "level". Is the intention that the value can be anything, e.g. some new event next month might use the values "1", "2, "3"? Just asking because ordinarily deprecated vs. terminally deprecated is very specific to the manner in which a program element is deprecated and I assume you don't want this event grabbing the general name for a very specific event setting. > >> A question about "level". Is the intention that the value can be anything, e.g. some new event next month might use the values "1", "2, "3"? Just asking because ordinarily deprecated vs. terminally deprecated is very specific to the manner in which a program element is deprecated and I assume you don't want this event grabbing the general name for a very specific event setting. > > Yes, the design is generic. An event control/setting to be used also for other events. Hi @mgronlun - sorry for opening a design discussion in PR :( I wonder - will this report each single one invocation of a deprecated method conforming to the rules (JDK method called from non-JDK code)? Can this, potentially, flood the recording if the deprecated method gets called from a hot loop? ------------- PR Comment: https://git.openjdk.org/jdk/pull/16931#issuecomment-1838232356 From mgronlun at openjdk.org Mon Dec 4 10:40:40 2023 From: mgronlun at openjdk.org (Markus =?UTF-8?B?R3LDtm5sdW5k?=) Date: Mon, 4 Dec 2023 10:40:40 GMT Subject: RFR: 8211238: @Deprecated JFR event [v8] In-Reply-To: References: Message-ID: On Sun, 3 Dec 2023 16:44:28 GMT, Markus Gr?nlund wrote: >> A question about "level". Is the intention that the value can be anything, e.g. some new event next month might use the values "1", "2, "3"? Just asking because ordinarily deprecated vs. terminally deprecated is very specific to the manner in which a program element is deprecated and I assume you don't want this event grabbing the general name for a very specific event setting. > >> A question about "level". Is the intention that the value can be anything, e.g. some new event next month might use the values "1", "2, "3"? Just asking because ordinarily deprecated vs. terminally deprecated is very specific to the manner in which a program element is deprecated and I assume you don't want this event grabbing the general name for a very specific event setting. > > Yes, the design is generic. An event control/setting to be used also for other events. > Hi @mgronlun - sorry for opening a design discussion in PR :( > > I wonder - will this report each single one invocation of a deprecated method conforming to the rules (JDK method called from non-JDK code)? Can this, potentially, flood the recording if the deprecated method gets called from a hot loop? Hi @jbachorik, it will only report one event per unique call site, during link time. Its not a function of hotness, only unique edge discovery. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16931#issuecomment-1838269120 From ihse at openjdk.org Mon Dec 4 11:32:09 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 4 Dec 2023 11:32:09 GMT Subject: RFR: 8307160: Fix AWT/2D/A11Y to support the permissive- flag on the Microsoft Visual C compiler [v45] In-Reply-To: References: <7piLRto5nNbhYYYfENCr5ecm4M2xNtMkjkE8XhrLLQ0=.8fd1ac3a-46f8-47a8-ae37-a4abbf7757d9@github.com> Message-ID: On Mon, 4 Dec 2023 09:39:09 GMT, Julian Waters wrote: >> We should set the -permissive- flag for the Microsoft Visual C compiler, as was requested by the now backed out [JDK-8241499](https://bugs.openjdk.org/browse/JDK-8241499). Doing so makes the Visual C compiler much less accepting of ill formed code, which will improve code quality on Windows in the future. > > Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 78 commits: > > - Merge branch 'openjdk:master' into patch-10 > - Fix awt_Window.cpp > - Fix awt_PrintJob.cpp > - -Zc:stringStrings no longer needed with -permissive- flags-cflags.m4 > - Fix awt_Window.cpp > - awt_Window.cpp > - awt_PrintJob.cpp > - awt_Frame.cpp > - Whitespace awt_Component.cpp > - awt_Frame.cpp > - ... and 68 more: https://git.openjdk.org/jdk/compare/ed5b8c3a...fda1ab0f make/autoconf/flags-cflags.m4 line 565: > 563: # The -utf-8 option sets source and execution character sets to UTF-8 to enable correct > 564: # compilation of all source files regardless of the active code page on Windows. > 565: TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -permissive- -utf-8 -MP" What is the rationale for removing `-Zc:strictStrings`? That seems like a step backwards. Also, this will affect *all* files compiled, both hotspot and all native JDK libraries. If there is a single file that cannot (for some reason) be fixed to have the compiler stop complaining about const strings, that individual file should have `-Zc:strictStrings-` added to its CFLAGS. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15096#discussion_r1413741134 From jwaters at openjdk.org Mon Dec 4 11:36:18 2023 From: jwaters at openjdk.org (Julian Waters) Date: Mon, 4 Dec 2023 11:36:18 GMT Subject: RFR: 8307160: Fix AWT/2D/A11Y to support the permissive- flag on the Microsoft Visual C compiler [v45] In-Reply-To: References: <7piLRto5nNbhYYYfENCr5ecm4M2xNtMkjkE8XhrLLQ0=.8fd1ac3a-46f8-47a8-ae37-a4abbf7757d9@github.com> Message-ID: On Mon, 4 Dec 2023 11:29:07 GMT, Magnus Ihse Bursie wrote: >> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 78 commits: >> >> - Merge branch 'openjdk:master' into patch-10 >> - Fix awt_Window.cpp >> - Fix awt_PrintJob.cpp >> - -Zc:stringStrings no longer needed with -permissive- flags-cflags.m4 >> - Fix awt_Window.cpp >> - awt_Window.cpp >> - awt_PrintJob.cpp >> - awt_Frame.cpp >> - Whitespace awt_Component.cpp >> - awt_Frame.cpp >> - ... and 68 more: https://git.openjdk.org/jdk/compare/ed5b8c3a...fda1ab0f > > make/autoconf/flags-cflags.m4 line 565: > >> 563: # The -utf-8 option sets source and execution character sets to UTF-8 to enable correct >> 564: # compilation of all source files regardless of the active code page on Windows. >> 565: TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -permissive- -utf-8 -MP" > > What is the rationale for removing `-Zc:strictStrings`? That seems like a step backwards. Also, this will affect *all* files compiled, both hotspot and all native JDK libraries. > > If there is a single file that cannot (for some reason) be fixed to have the compiler stop complaining about const strings, that individual file should have `-Zc:strictStrings-` added to its CFLAGS. @magicus -permissive- automatically turns on -Zc:strictStrings, so specifying it manually becomes redundant when -permissive- is also specified https://learn.microsoft.com/en-us/cpp/build/reference/zc-strictstrings-disable-string-literal-type-conversion?view=msvc-170 > The -Zc:strictStrings option is off by default. The [-permissive-](https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170) compiler option implicitly sets this option, but it can be overridden by using -Zc:strictStrings- ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15096#discussion_r1413745163 From ihse at openjdk.org Mon Dec 4 11:41:40 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 4 Dec 2023 11:41:40 GMT Subject: RFR: 8321224: ct.sym for JDK 22 contains references to internal modules In-Reply-To: References: Message-ID: <5vLxKqST7AYhrmXhRNKfYhpAK_Z2wAOSSfxKX9L9z9s=.136fcc0d-880a-4e2e-ac2c-82c92d10e0cc@github.com> On Sun, 3 Dec 2023 21:31:42 GMT, Jan Lahoda wrote: > As part of: > https://github.com/openjdk/jdk/pull/16505 > > there are new symbol files for JDK 22, and @jddarcy noted the content looks weird. > > I was investigating, and found a few problems, some introduced by https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, some pre-existing. > > Note that https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b changed the way we generate `ct.sym` - it now contains `.sig` files also for the current JDK, not only for the past versions. Before this patch, `ct.sym` only contained a list of permitted modules for the current JDK, and the classfiles themselves were read from `lib/modules`. > > The problems (and their solution) I've attempted to tackle here: > - since https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, the ct.sym accidentally includes all modules for the current release, including non-API/undocumented modules. The proposed solution is to pass the documented modules together with their transitive dependencies as a parameter when constructing ct.sym, then use them to only generate data for these modules. > - there are tiny differences between the data that are in `ct.sym` and in the `.sym.txt` historical files, mostly around annotations. The `.sym.txt` files contain references to internal annotations (like `@PreviewFeature`), which are stripped or converted before the `.sig` file is written into `ct.sym`. When generating historical data for JDK N, we run `CreateSymbols` on JDK N, reading the JDK N classfiles, and producing `.sym.txt`. This is done using `--release N`, so that we read the correct span of modules. Sadly, since now `--release N` will always use the `.sig` files, we are loosing a little bit of information esp. around the annotations. The proposal here is to use `--release N` to read the list of modules to cover, and `--source N` to read the actual real classfiles from `lib/modules`. This should basically revert the behavior to the previous state. > - this is an existing issue, but one that needs to be fixed. Sealed types are not written and read properly - writing was not storing them, and reading permitted subclasses was happening too late, not on the `header` line. Note that when fixing this, we now must store some of the non-exported elements, which are reachable through the permitted subclasses, so that casting works as expected. Also, since the historical record is incorrect here, I re-run the generator for JDK 17-21 (as sealed c... make/modules/jdk.compiler/Gendata.gmk line 41: > 39: CT_MODULES := $(filter-out $(MODULES_FILTER), $(DOCS_MODULES)) > 40: CT_EXTRA_MODULES := jdk.unsupported > 41: CT_TRANSITIVE_MODULES := $(call FindTransitiveIndirectDepsForModules, $(CT_MODULES)) $(CT_MODULES) Now the CT_TRANSITIVE_MODULES will include all CT_MODULES. I am pretty sure the intention was to keep them separated, for clarity, but to act on both CT_MODULES and CT_TRANSITIVE_MODULES. See e.g. the foreach on line 43. (This change will also make that foreach process CT_MODULES twice.) Also, just for code readability, can you move the hard-coded list of extra modules to after the programmatic definitions of CT_MODULES and transitive modules, perhaps even with an empty line in between? I think a better solution is to change your new line to: $(ECHO) $(CT_MODULES) $(CT_TRANSITIVE_MODULES) $(CT_EXTRA_MODULES) >$(SUPPORT_OUTPUTDIR)/symbols/included-modules ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16942#discussion_r1413751161 From ihse at openjdk.org Mon Dec 4 11:47:24 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 4 Dec 2023 11:47:24 GMT Subject: RFR: 8307160: Fix AWT/2D/A11Y to support the permissive- flag on the Microsoft Visual C compiler [v45] In-Reply-To: References: <7piLRto5nNbhYYYfENCr5ecm4M2xNtMkjkE8XhrLLQ0=.8fd1ac3a-46f8-47a8-ae37-a4abbf7757d9@github.com> Message-ID: On Mon, 4 Dec 2023 11:33:09 GMT, Julian Waters wrote: >> make/autoconf/flags-cflags.m4 line 565: >> >>> 563: # The -utf-8 option sets source and execution character sets to UTF-8 to enable correct >>> 564: # compilation of all source files regardless of the active code page on Windows. >>> 565: TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -permissive- -utf-8 -MP" >> >> What is the rationale for removing `-Zc:strictStrings`? That seems like a step backwards. Also, this will affect *all* files compiled, both hotspot and all native JDK libraries. >> >> If there is a single file that cannot (for some reason) be fixed to have the compiler stop complaining about const strings, that individual file should have `-Zc:strictStrings-` added to its CFLAGS. > > @magicus -permissive- automatically turns on -Zc:strictStrings, so specifying it manually becomes redundant when -permissive- is also specified > https://learn.microsoft.com/en-us/cpp/build/reference/zc-strictstrings-disable-string-literal-type-conversion?view=msvc-170 > >> The -Zc:strictStrings option is off by default. The [-permissive-](https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170) compiler option implicitly sets this option, but it can be overridden by using -Zc:strictStrings- I see. Then I guess this is okay. If/when you are finally ready for integration, and turning on -permissive-, let me know so I can take the patch for a spin in our CI systems before integration. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15096#discussion_r1413756555 From ihse at openjdk.org Mon Dec 4 11:51:38 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 4 Dec 2023 11:51:38 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v6] In-Reply-To: References: Message-ID: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> On Thu, 30 Nov 2023 20:19:56 GMT, Srinivas Vamsi Parasa wrote: >> Raising the minimum gcc version is not done willy-nilly. (I feel a "You just don't ..." meme coming up) >> >> But you are saying that you want to skip building this library unless you have a gcc version that supports c++17? >> >> I still don't really like it. I'd like to hear someone else who can think clearly about this, if we want to go down this path, and start adding libraries that use C++17. Maybe @kimbarrett has some input? > >> But you are saying that you want to skip building this library unless you have a gcc version that supports c++17? >> > Yes, the request is to skip building the simdsort library if GCC version is < 8 as only GCC >= 8 supports C++17 features. Then you must add logic to check for this. Now the build will just fail if building with an older gcc. That is not acceptable. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1413761798 From ihse at openjdk.org Mon Dec 4 12:01:47 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 4 Dec 2023 12:01:47 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: <3cK9QjVQNIgZoWWhrWKEb3XxfbLjprjRMBbStWegH7M=.6df92651-b97d-445a-aa42-302ea791bbea@github.com> Message-ID: On Fri, 1 Dec 2023 16:49:28 GMT, Andrew Haley wrote: >> Oh, and: >> >> If we can't trust SLEEF not to break the ABI we're using, we should not be using SLEEF. > >> @theRealAph You are making good points. >> >> You are basically saying: "we don't need any configure support for libsleef, we can just hard-code the names and dispatch to them directly to a dlopened library at runtime". > > Yep. > >> That is technically correct, but I'd still like to argue that the current setup have some merits: >> >> * It will check that there is no typo in the function names. I agree that the likelihood of getting this wrong is low, but it is still a good practice to use official include files to have the compiler help checking this. >> >> * If we would like to bundle libsleef.so with the JVM, now we have the possibility do do so easily. (Especially if it is like you say that it is not commonly installed). (If licenses allow etc) >> >> * If we want to incorporate/bundle the source code of libsleef into OpenJDK, and build it as part of our internal library, we will have a good starting position, compared to starting from a hard-coded assembly file in hotspot. (I thought I heard some noise about this prospect). >> >> >> So at this point, I am okay with the general approach of this PR. There are still some build issues to sort out, though, I'll address them separately. > > I see, OK. The question in my mind is whether the common builds of OpenJDK (Oracle, Adoptium, etc.) will support running with SLEEF. If by default SLEEF is not required, support won't be built, and (to an nth order approximation) no one will use it. But I guess it's better than nothing. > > Or is there likely to be a plan to e.g. build Oracle's releases with SLEEF support? @theRealAph > Or is there likely to be a plan to e.g. build Oracle's releases with SLEEF support? I can't say anything for sure, but I picked up some positive vibes from our internal chat. I think the idea was that libsleef could potentially cover up vector math for all platforms that the current Intel lib solution is missing (basically, everything but linux+windows x64). So I this can be seen as a bit of a trial balloon if it is worth a more complete integration of libsleef in the JDK. And I can't say anything at all about what Oracle JDKs are going to release with, but I am fully open towards adding libsleef to the GHA builds. And I'm guessing that Adoptium has no reason not to include libsleef, but then again, I cannot of course speak for them. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1838489588 From ihse at openjdk.org Mon Dec 4 12:04:45 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 4 Dec 2023 12:04:45 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: <_oX3Rqyygpj-612IlxZBZOZQnauEyTBjE4goHDa4Ov8=.0ccafde6-c95e-469d-aee6-77a2e75ee7a7@github.com> On Mon, 4 Dec 2023 08:31:17 GMT, Xiaohong Gong wrote: >> The final thing we need to resolve properly is the SVE compiler test. >> >> @theRealAph says: >>> arm_sve.h is part of GCC. It was added to GCC in 2019. >> >> A more relevant question is what version of gcc it was added, and if that also implies that the compiler knows about `-march=armv8-a+sve`. If so, then this test could basically be framed as a gcc version check. >> >> I'm still leaning towards failing configure if the SVE code cannot be compiled. Under what circumstances can this test possibly fail, so SVE_CFLAGS would not be set? > >> The final thing we need to resolve properly is the SVE compiler test. >> >> @theRealAph says: >> >> > arm_sve.h is part of GCC. It was added to GCC in 2019. >> >> A more relevant question is what version of gcc it was added, and if that also implies that the compiler knows about `-march=armv8-a+sve`. If so, then this test could basically be framed as a gcc version check. >> >> I'm still leaning towards failing configure if the SVE code cannot be compiled. Under what circumstances can this test possibly fail, so SVE_CFLAGS would not be set? > > Yes, the SVE compiler test code could be treated as a gcc/clang version check. `arm_sve.h` which is included in `sleef.h` and then in `vect_math_sve.c` is the SVE ACLE (Arm C Language Extensions) header file. It was included in gcc start from version 10 (may not be exact, but gcc 8/9 would fail when compile c code including this header). We have to make sure the compiler supports the SVE ACLE before using it. Here are the different scenarios: > > 1. The SVE compiler test success, and `SVE_CFLAGS` is set to `-march=armv8-a+sve`. All symbols in `libvmath.so` are built successfully including NEON/SVE. Hence, the vector math operations with all kinds of vector size on both NEON/SVE machines will be improved as expected. > 2. The SVE compiler test fail, and `SVE_CFLAGS` is null. SVE symbols in `libvmath.so` cannot be built out. Only NEON symbols exist in `libvmath.so`. Hence, the enhancement for vector math operations with > 128-bit vector size on SVE machines are missing. @XiaohongGong If we are sure that the SVE test will always succeed when running on gcc 10 or higher, then I guess I don't really need a way to enforce SVE support -- you'll just have to make sure you use a recent enough gcc. But, then the entire test becomes a bit unnecessary. You can just replace it with a version check on gcc, or perhaps a FLAGS_COMPILER_CHECK_ARGUMENTS on `-march=armv8-a+sve`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1838495553 From vromero at openjdk.org Mon Dec 4 19:42:47 2023 From: vromero at openjdk.org (Vicente Romero) Date: Mon, 4 Dec 2023 19:42:47 GMT Subject: RFR: 8321224: ct.sym for JDK 22 contains references to internal modules In-Reply-To: References: Message-ID: On Sun, 3 Dec 2023 21:31:42 GMT, Jan Lahoda wrote: > As part of: > https://github.com/openjdk/jdk/pull/16505 > > there are new symbol files for JDK 22, and @jddarcy noted the content looks weird. > > I was investigating, and found a few problems, some introduced by https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, some pre-existing. > > Note that https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b changed the way we generate `ct.sym` - it now contains `.sig` files also for the current JDK, not only for the past versions. Before this patch, `ct.sym` only contained a list of permitted modules for the current JDK, and the classfiles themselves were read from `lib/modules`. > > The problems (and their solution) I've attempted to tackle here: > - since https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, the ct.sym accidentally includes all modules for the current release, including non-API/undocumented modules. The proposed solution is to pass the documented modules together with their transitive dependencies as a parameter when constructing ct.sym, then use them to only generate data for these modules. > - there are tiny differences between the data that are in `ct.sym` and in the `.sym.txt` historical files, mostly around annotations. The `.sym.txt` files contain references to internal annotations (like `@PreviewFeature`), which are stripped or converted before the `.sig` file is written into `ct.sym`. When generating historical data for JDK N, we run `CreateSymbols` on JDK N, reading the JDK N classfiles, and producing `.sym.txt`. This is done using `--release N`, so that we read the correct span of modules. Sadly, since now `--release N` will always use the `.sig` files, we are loosing a little bit of information esp. around the annotations. The proposal here is to use `--release N` to read the list of modules to cover, and `--source N` to read the actual real classfiles from `lib/modules`. This should basically revert the behavior to the previous state. > - this is an existing issue, but one that needs to be fixed. Sealed types are not written and read properly - writing was not storing them, and reading permitted subclasses was happening too late, not on the `header` line. Note that when fixing this, we now must store some of the non-exported elements, which are reachable through the permitted subclasses, so that casting works as expected. Also, since the historical record is incorrect here, I re-run the generator for JDK 17-21 (as sealed c... looks sensible to me ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16942#pullrequestreview-1763256790 From jlahoda at openjdk.org Mon Dec 4 21:27:57 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 4 Dec 2023 21:27:57 GMT Subject: RFR: 8321224: ct.sym for JDK 22 contains references to internal modules [v2] In-Reply-To: References: Message-ID: > As part of: > https://github.com/openjdk/jdk/pull/16505 > > there are new symbol files for JDK 22, and @jddarcy noted the content looks weird. > > I was investigating, and found a few problems, some introduced by https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, some pre-existing. > > Note that https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b changed the way we generate `ct.sym` - it now contains `.sig` files also for the current JDK, not only for the past versions. Before this patch, `ct.sym` only contained a list of permitted modules for the current JDK, and the classfiles themselves were read from `lib/modules`. > > The problems (and their solution) I've attempted to tackle here: > - since https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, the ct.sym accidentally includes all modules for the current release, including non-API/undocumented modules. The proposed solution is to pass the documented modules together with their transitive dependencies as a parameter when constructing ct.sym, then use them to only generate data for these modules. > - there are tiny differences between the data that are in `ct.sym` and in the `.sym.txt` historical files, mostly around annotations. The `.sym.txt` files contain references to internal annotations (like `@PreviewFeature`), which are stripped or converted before the `.sig` file is written into `ct.sym`. When generating historical data for JDK N, we run `CreateSymbols` on JDK N, reading the JDK N classfiles, and producing `.sym.txt`. This is done using `--release N`, so that we read the correct span of modules. Sadly, since now `--release N` will always use the `.sig` files, we are loosing a little bit of information esp. around the annotations. The proposal here is to use `--release N` to read the list of modules to cover, and `--source N` to read the actual real classfiles from `lib/modules`. This should basically revert the behavior to the previous state. > - this is an existing issue, but one that needs to be fixed. Sealed types are not written and read properly - writing was not storing them, and reading permitted subclasses was happening too late, not on the `header` line. Note that when fixing this, we now must store some of the non-exported elements, which are reachable through the permitted subclasses, so that casting works as expected. Also, since the historical record is incorrect here, I re-run the generator for JDK 17-21 (as sealed c... Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: Reflecting review feedback - keeping CT_TRANSITIVE_MODULES separate from CT_MODULES. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16942/files - new: https://git.openjdk.org/jdk/pull/16942/files/c65eb44b..87927789 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16942&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16942&range=00-01 Stats: 6 lines in 1 file changed: 3 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/16942.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16942/head:pull/16942 PR: https://git.openjdk.org/jdk/pull/16942 From jlahoda at openjdk.org Mon Dec 4 21:27:59 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 4 Dec 2023 21:27:59 GMT Subject: RFR: 8321224: ct.sym for JDK 22 contains references to internal modules [v2] In-Reply-To: <5vLxKqST7AYhrmXhRNKfYhpAK_Z2wAOSSfxKX9L9z9s=.136fcc0d-880a-4e2e-ac2c-82c92d10e0cc@github.com> References: <5vLxKqST7AYhrmXhRNKfYhpAK_Z2wAOSSfxKX9L9z9s=.136fcc0d-880a-4e2e-ac2c-82c92d10e0cc@github.com> Message-ID: On Mon, 4 Dec 2023 11:39:04 GMT, Magnus Ihse Bursie wrote: >> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: >> >> Reflecting review feedback - keeping CT_TRANSITIVE_MODULES separate from CT_MODULES. > > make/modules/jdk.compiler/Gendata.gmk line 41: > >> 39: CT_MODULES := $(filter-out $(MODULES_FILTER), $(DOCS_MODULES)) >> 40: CT_EXTRA_MODULES := jdk.unsupported >> 41: CT_TRANSITIVE_MODULES := $(call FindTransitiveIndirectDepsForModules, $(CT_MODULES)) $(CT_MODULES) > > Now the CT_TRANSITIVE_MODULES will include all CT_MODULES. I am pretty sure the intention was to keep them separated, for clarity, but to act on both CT_MODULES and CT_TRANSITIVE_MODULES. See e.g. the foreach on line 43. (This change will also make that foreach process CT_MODULES twice.) > > Also, just for code readability, can you move the hard-coded list of extra modules to after the programmatic definitions of CT_MODULES and transitive modules, perhaps even with an empty line in between? > > I think a better solution is to change your new line to: > > $(ECHO) $(CT_MODULES) $(CT_TRANSITIVE_MODULES) $(CT_EXTRA_MODULES) >$(SUPPORT_OUTPUTDIR)/symbols/included-modules Thanks for the comment! I tried to act on it here: https://github.com/openjdk/jdk/pull/16942/commits/879277891708533b0b56dbe36b20760c62708bbf ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16942#discussion_r1414515956 From duke at openjdk.org Mon Dec 4 21:55:36 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Mon, 4 Dec 2023 21:55:36 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v7] In-Reply-To: References: Message-ID: > The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. > > For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. > > For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. > > **Note:** This PR also improves the performance of AVX512 sort by upto 35%. > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> > > > > > > > > > Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup > -- | -- | -- | -- | -- > ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 > ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 > ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 > ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 > ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 > ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 > ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 > ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 > ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 > ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 > ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 > ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 > ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 > ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 > ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 > ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 > ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 > ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 > > > > > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/... Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: add GCC version guards ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16534/files - new: https://git.openjdk.org/jdk/pull/16534/files/d957f413..bb5f711a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=05-06 Stats: 42 lines in 3 files changed: 42 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/16534.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16534/head:pull/16534 PR: https://git.openjdk.org/jdk/pull/16534 From duke at openjdk.org Mon Dec 4 22:15:24 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Mon, 4 Dec 2023 22:15:24 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: References: Message-ID: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> > The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. > > For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. > > For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. > > **Note:** This PR also improves the performance of AVX512 sort by upto 35%. > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> > > > > > > > > > Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup > -- | -- | -- | -- | -- > ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 > ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 > ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 > ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 > ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 > ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 > ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 > ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 > ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 > ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 > ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 > ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 > ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 > ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 > ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 > ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 > ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 > ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 > > > > > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/... Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision: - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort - add GCC version guards - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort - Remove C++17 from C flags - add avoid masked stores operation - update the code to check for supported simd sort cpus - Disable AVX2 sort for 64-bit types - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort - fix jcheck failures due to windows encoding - fix carriage return and change insertion sort thresholds - ... and 7 more: https://git.openjdk.org/jdk/compare/0b17dc14...bc590d9f ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16534/files - new: https://git.openjdk.org/jdk/pull/16534/files/bb5f711a..bc590d9f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=06-07 Stats: 36176 lines in 1033 files changed: 17425 ins; 14551 del; 4200 mod Patch: https://git.openjdk.org/jdk/pull/16534.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16534/head:pull/16534 PR: https://git.openjdk.org/jdk/pull/16534 From duke at openjdk.org Mon Dec 4 22:18:35 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Mon, 4 Dec 2023 22:18:35 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> References: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> Message-ID: On Mon, 4 Dec 2023 11:48:44 GMT, Magnus Ihse Bursie wrote: >>> But you are saying that you want to skip building this library unless you have a gcc version that supports c++17? >>> >> Yes, the request is to skip building the simdsort library if GCC version is < 8 as only GCC >= 8 supports C++17 features. > > Then you must add logic to check for this. Now the build will just fail if building with an older gcc. That is not acceptable. Hi Marcus (@magicus), please see the updated code which added guards to check for GCC version >= 7.5 in `src/java.base/linux/native/libsimdsort/{avx2-linux-qsort.cpp, avx512-linux-qsort.cpp}`. GCC >= 7.5 is needed to compile libsimdsort using C++17 features. Made sure that OpenJDK builds without errors using both GCC 7.5 and GCC 6.4. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1414570644 From sviswanathan at openjdk.org Tue Dec 5 00:10:38 2023 From: sviswanathan at openjdk.org (Sandhya Viswanathan) Date: Tue, 5 Dec 2023 00:10:38 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> References: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> Message-ID: <5JnWpXMWKZ85mosrUdVrdNLRyHWF_HNW3h8krKWO63k=.63bf3ffa-63a1-4ce4-b972-278655e8a567@github.com> On Mon, 4 Dec 2023 22:15:24 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision: > > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - add GCC version guards > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - Remove C++17 from C flags > - add avoid masked stores operation > - update the code to check for supported simd sort cpus > - Disable AVX2 sort for 64-bit types > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - fix jcheck failures due to windows encoding > - fix carriage return and change insertion sort thresholds > - ... and 7 more: https://git.openjdk.org/jdk/compare/d4804a12...bc590d9f The PR looks good to me. ------------- Marked as reviewed by sviswanathan (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16534#pullrequestreview-1763680754 From duke at openjdk.org Tue Dec 5 00:50:41 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Tue, 5 Dec 2023 00:50:41 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> References: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> Message-ID: On Mon, 4 Dec 2023 22:15:24 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision: > > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - add GCC version guards > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - Remove C++17 from C flags > - add avoid masked stores operation > - update the code to check for supported simd sort cpus > - Disable AVX2 sort for 64-bit types > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - fix jcheck failures due to windows encoding > - fix carriage return and change insertion sort thresholds > - ... and 7 more: https://git.openjdk.org/jdk/compare/0dc47dcf...bc590d9f Hello Vladimir (@vnkozlov), Could you please review this PR? Thanks, Vamsi ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1839810768 From darcy at openjdk.org Tue Dec 5 01:48:14 2023 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 5 Dec 2023 01:48:14 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v5] In-Reply-To: References: Message-ID: > Time to start making preparations for JDK 23. Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: - Merge branch 'master' into JDK-8319413 - Add symbol files. - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Update symbol files to JDK 22 b26. - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Add symbol files for JDK 22 build 25. - ... and 5 more: https://git.openjdk.org/jdk/compare/30b5d427...2ee6cb96 ------------- Changes: https://git.openjdk.org/jdk/pull/16505/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16505&range=04 Stats: 12598 lines in 97 files changed: 12560 ins; 0 del; 38 mod Patch: https://git.openjdk.org/jdk/pull/16505.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16505/head:pull/16505 PR: https://git.openjdk.org/jdk/pull/16505 From xgong at openjdk.org Tue Dec 5 02:08:40 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Tue, 5 Dec 2023 02:08:40 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: On Mon, 4 Dec 2023 08:31:17 GMT, Xiaohong Gong wrote: >> The final thing we need to resolve properly is the SVE compiler test. >> >> @theRealAph says: >>> arm_sve.h is part of GCC. It was added to GCC in 2019. >> >> A more relevant question is what version of gcc it was added, and if that also implies that the compiler knows about `-march=armv8-a+sve`. If so, then this test could basically be framed as a gcc version check. >> >> I'm still leaning towards failing configure if the SVE code cannot be compiled. Under what circumstances can this test possibly fail, so SVE_CFLAGS would not be set? > >> The final thing we need to resolve properly is the SVE compiler test. >> >> @theRealAph says: >> >> > arm_sve.h is part of GCC. It was added to GCC in 2019. >> >> A more relevant question is what version of gcc it was added, and if that also implies that the compiler knows about `-march=armv8-a+sve`. If so, then this test could basically be framed as a gcc version check. >> >> I'm still leaning towards failing configure if the SVE code cannot be compiled. Under what circumstances can this test possibly fail, so SVE_CFLAGS would not be set? > > Yes, the SVE compiler test code could be treated as a gcc/clang version check. `arm_sve.h` which is included in `sleef.h` and then in `vect_math_sve.c` is the SVE ACLE (Arm C Language Extensions) header file. It was included in gcc start from version 10 (may not be exact, but gcc 8/9 would fail when compile c code including this header). We have to make sure the compiler supports the SVE ACLE before using it. Here are the different scenarios: > > 1. The SVE compiler test success, and `SVE_CFLAGS` is set to `-march=armv8-a+sve`. All symbols in `libvmath.so` are built successfully including NEON/SVE. Hence, the vector math operations with all kinds of vector size on both NEON/SVE machines will be improved as expected. > 2. The SVE compiler test fail, and `SVE_CFLAGS` is null. SVE symbols in `libvmath.so` cannot be built out. Only NEON symbols exist in `libvmath.so`. Hence, the enhancement for vector math operations with > 128-bit vector size on SVE machines are missing. > @XiaohongGong If we are sure that the SVE test will always succeed when running on gcc 10 or higher, then I guess I don't really need a way to enforce SVE support -- you'll just have to make sure you use a recent enough gcc. > > But, then the entire test becomes a bit unnecessary. You can just replace it with a version check on gcc, or perhaps a FLAGS_COMPILER_CHECK_ARGUMENTS on `-march=armv8-a+sve`. Thanks for the suggestion @magicus ! Replacing with a version check for the c compiler seems fine. But I cannot see the advantange than current test. Here are the reasons: 1. `-march=armv8-a+sve` is the necessary cflag for the sve source, and only included start from some c compiler versions. The c compiler version check must happen before using it. So it should also happen in the make or configure stage? Hence, we still have to find a right place to check it (should be in `lib-sleef.m4` or otherwhere?). 2. We not only have to check the gcc version, but also have to check the clang version. Would this make the code more complex? Regarding to using `FLAGS_COMPILER_CHECK_ARGUMENTS on "-march=armv8-a+sve"`, it is not right as well. Because we have to make sure the c compiler supports SVE ACLE completely which contains the sve header `arm_sve.h`. The compiler that supports option `-march=armv8-a+sve` cannot make sure the SVE ACLE is supported as well. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1839875881 From iris at openjdk.org Tue Dec 5 05:40:40 2023 From: iris at openjdk.org (Iris Clark) Date: Tue, 5 Dec 2023 05:40:40 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v5] In-Reply-To: References: Message-ID: On Tue, 5 Dec 2023 01:48:14 GMT, Joe Darcy wrote: >> Time to start making preparations for JDK 23. > > Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: > > - Merge branch 'master' into JDK-8319413 > - Add symbol files. > - Merge branch 'master' into JDK-8319413 > - Merge branch 'master' into JDK-8319413 > - Merge branch 'master' into JDK-8319413 > - Merge branch 'master' into JDK-8319413 > - Update symbol files to JDK 22 b26. > - Merge branch 'master' into JDK-8319413 > - Merge branch 'master' into JDK-8319413 > - Add symbol files for JDK 22 build 25. > - ... and 5 more: https://git.openjdk.org/jdk/compare/30b5d427...2ee6cb96 Marked as reviewed by iris (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/16505#pullrequestreview-1764000855 From iris at openjdk.org Tue Dec 5 05:40:44 2023 From: iris at openjdk.org (Iris Clark) Date: Tue, 5 Dec 2023 05:40:44 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v4] In-Reply-To: <8B_EG0mwCKb3mRlrAoyz7vkzZhNPpZUAfY-EOQ1FlEo=.efbc5ce9-1a75-4aa2-8dfc-96a9c9fd03b7@github.com> References: <8B_EG0mwCKb3mRlrAoyz7vkzZhNPpZUAfY-EOQ1FlEo=.efbc5ce9-1a75-4aa2-8dfc-96a9c9fd03b7@github.com> Message-ID: On Sat, 2 Dec 2023 20:40:57 GMT, Andrey Turbanov wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Update symbol files to JDK 22 b26. > > test/langtools/tools/javac/versions/Versions.java line 97: > >> 95: TWENTY_ONE(false,"65.0", "21"), >> 96: TWENTY_TWO(false,"66.0", "22"), >> 97: TWENTY_THREE(false,"67.0", "23"), > > As alignment is broken anyway, let's add space > Suggestion: > > TWENTY_THREE(false, "67.0", "23"), If you're going to add the space, I'd consider establishing new alignment at TWENTY to accommodate the eventual space needed for "THREE", "SEVEN", and "EIGHT". You wouldn't need to reset alignment for quite some time after that. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16505#discussion_r1414904341 From xgong at openjdk.org Tue Dec 5 07:24:42 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Tue, 5 Dec 2023 07:24:42 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: <9VeMdTAJPaPZDg9ZW7FVJOf9XGl4gGqAS-2g8SFc9c0=.36792cd5-66d9-4abc-ba0c-aee3478627f4@github.com> Message-ID: On Fri, 1 Dec 2023 16:36:18 GMT, Magnus Ihse Bursie wrote: >> You need to expand this logic to cover more instances. See e.g. lib-ffi.m4 for inspiration. >> >> Basic flow: >> * if user has specified libsleef root with argument, check both lib/ and lib64/ under that root. >> * if user has not specified libsleef root, and we have no SYSROOT, try PKG_CHECK >> * Otherwise, look in well-known directories which is $SYSROOT/usr/[local/]lib[64]. > > also, ideally, you will add the corresponding specific overrides like in ffi: > > AC_ARG_WITH(libffi-include, [AS_HELP_STRING([--with-libffi-include], > [specify directory for the libffi include files])]) > AC_ARG_WITH(libffi-lib, [AS_HELP_STRING([--with-libffi-lib], > [specify directory for the libffi library])]) Thanks for the suggestion @magicus ! The check in current `lib-sleef.m4` is very common: - If user has specified libsleef root by '--with-libsleef', we assume it is the manually built sleef lib. So only `lib/` and `include/` is checked. And the flags are set based on that path. - If user has not specified the libsleef root, and no `SYSROOT` is set, we try `PKG_CHECK` (like what you suggested) - Otherwise, check `sleef.h` - We assume the sleef module is installed under one of the valid system paths if the header can be found. So just linking with `-lsleef` will success. It's an issue in current flow like what @theRealAph met. I will add the options like `--with-libsleef-lib` and `--with-libsleef-include` like ffi. Regarding to extending the check for`--with-libsleef`, I think we can just make it simple like what it is now. Or, we have to check all the potential valid lib paths like `lib/`, `lib64/`, or maybe `lib/aarch64-linux-gnu`. The same to the `include` part. @theRealAph @magicus , WDYT? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1414980861 From asotona at openjdk.org Tue Dec 5 09:01:38 2023 From: asotona at openjdk.org (Adam Sotona) Date: Tue, 5 Dec 2023 09:01:38 GMT Subject: RFR: 8321224: ct.sym for JDK 22 contains references to internal modules [v2] In-Reply-To: References: Message-ID: On Mon, 4 Dec 2023 21:27:57 GMT, Jan Lahoda wrote: >> As part of: >> https://github.com/openjdk/jdk/pull/16505 >> >> there are new symbol files for JDK 22, and @jddarcy noted the content looks weird. >> >> I was investigating, and found a few problems, some introduced by https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, some pre-existing. >> >> Note that https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b changed the way we generate `ct.sym` - it now contains `.sig` files also for the current JDK, not only for the past versions. Before this patch, `ct.sym` only contained a list of permitted modules for the current JDK, and the classfiles themselves were read from `lib/modules`. >> >> The problems (and their solution) I've attempted to tackle here: >> - since https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, the ct.sym accidentally includes all modules for the current release, including non-API/undocumented modules. The proposed solution is to pass the documented modules together with their transitive dependencies as a parameter when constructing ct.sym, then use them to only generate data for these modules. >> - there are tiny differences between the data that are in `ct.sym` and in the `.sym.txt` historical files, mostly around annotations. The `.sym.txt` files contain references to internal annotations (like `@PreviewFeature`), which are stripped or converted before the `.sig` file is written into `ct.sym`. When generating historical data for JDK N, we run `CreateSymbols` on JDK N, reading the JDK N classfiles, and producing `.sym.txt`. This is done using `--release N`, so that we read the correct span of modules. Sadly, since now `--release N` will always use the `.sig` files, we are loosing a little bit of information esp. around the annotations. The proposal here is to use `--release N` to read the list of modules to cover, and `--source N` to read the actual real classfiles from `lib/modules`. This should basically revert the behavior to the previous state. >> - this is an existing issue, but one that needs to be fixed. Sealed types are not written and read properly - writing was not storing them, and reading permitted subclasses was happening too late, not on the `header` line. Note that when fixing this, we now must store some of the non-exported elements, which are reachable through the permitted subclasses, so that casting works as expected. Also, since the historical record is incorrect here, I re-run the generator ... > > Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: > > Reflecting review feedback - keeping CT_TRANSITIVE_MODULES separate from CT_MODULES. Marked as reviewed by asotona (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/16942#pullrequestreview-1764410922 From magnus.ihse.bursie at oracle.com Tue Dec 5 10:36:09 2023 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Tue, 5 Dec 2023 11:36:09 +0100 Subject: Compile Errors in OpenJDK 11 with Non-English Characters in Compilation Path In-Reply-To: References: <5b3c1d56-e1e1-4afd-a117-e1e9af6ac73a@oracle.com> Message-ID: On closer inspection, it would probably be more prudential to set the value of LC_ALL to C.UTF-8 in the build. It will likely help you with your problem. I have published a PR at https://github.com/openjdk/jdk/pull/16971 (JDK-8321373). /Magnus On 2023-11-24 13:08, Magnus Ihse Bursie wrote: > > Are you running on Ubuntu properly, or Ubuntu in WLS? If it is the > former, the it is not the same problem as the other poster, which were > running on Windows. > > The JDK build uses the "C" locale. This should be set automatically by > the build system, so it should just work. But in case there is some > bug, try exporting LC_ALL=C before building and see if it helps. > > Also, the point of LC_ALL is that you can specify it instead of all > the detailed LC_* variables... > > /Magnus > > On 2023-11-24 08:41, last last wrote: >> I am currently facing the same error when build paths include Chinese >> characters ,after setting the environment variable "export >> LC_ALL=zh_CN.UTF-8" .The testing environment is also Ubuntu 2004. >> The system locale settings are as follows:LANG=zh_CN.UTF-8 >> LANGUAGE=zh_CN:zh LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" >> LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" >> LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" >> LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" >> LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUREMENT="zh_CN.UTF-8" >> LC_IDENTIFICATION="zh_CN.UTF-8" LC_ALL=zh_CN.UTF-8 >> I'm wondering if there are any other system configurations that could >> help resolve this problem. Your insights would be greatly appreciated. >> >> Magnus Ihse Bursie ?2023?11?23??? >> 22:30??? >> >> Congratulations! You get to test drive the recently updated build >> instructions for Windows locale requirements! :-) >> >> Please see >> https://github.com/openjdk/jdk/blob/master/doc/building.md#locale-requirements >> >> In particular, I believe you need to set your system locale. >> >> Please report back if that solves the problem or not. >> >> /Magnus >> >> >> On 2023-11-23 03:51, last last wrote: >> > Hi all, >> > >> > I tried to build a OpenJDK11 fastdebug with paths that include >> Chinese >> > characters?my build path is "/home/kylin/??/jdk11u-dev"?but i >> saw some >> > error as followings: >> > >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at >> java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > make[3]: *** [ToolsLangtools.gmk:40: >> > >> /home/kylin/??/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch] >> >> > Error 1 >> > make[2]: *** [make/Main.gmk:73: buildtools-langtools] Error 2 >> > make[2]: *** Waiting for unfinished jobs.... >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/tools/jvmti/_the.BUILD_JVMTI_TOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at >> java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > make[3]: *** [gensrc/GensrcJvmti.gmk:45: >> > >> /home/kylin/??/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/tools/jvmti/_the.BUILD_JVMTI_TOOLS_batch] >> >> > Error 1 >> > make[3]: *** Waiting for unfinished jobs.... >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/buildtools/tools_classes/_the.BUILD_JFR_TOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at >> java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > make[3]: *** [gensrc/GensrcJfr.gmk:43: >> > >> /home/kylin/??/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/buildtools/tools_classes/_the.BUILD_JFR_TOOLS_batch] >> >> > Error 1 >> > make[2]: *** [make/Main.gmk:265: hotspot-server-gensrc] Error 2 >> > >> > ERROR: Build failed for target 'images' in configuration >> > 'linux-aarch64-normal-server-fastdebug' (exit code 2) >> > >> > === Output from failing command(s) repeated here === >> > * For target >> > >> buildtools_langtools_tools_classes__the.BUILD_TOOLS_LANGTOOLS_batch: >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at >> java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > * For target >> > >> hotspot_variant-server_buildtools_tools_classes__the.BUILD_JFR_TOOLS_batch: >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/buildtools/tools_classes/_the.BUILD_JFR_TOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at >> java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > * For target >> > hotspot_variant-server_tools_jvmti__the.BUILD_JVMTI_TOOLS_batch: >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/tools/jvmti/_the.BUILD_JVMTI_TOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at >> java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at >> jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > >> > * All command lines available in >> > >> /home/kylin/??/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/make-support/failure-logs. >> > >> > ---------- >> > This error only arises when the compilation path contains Chinese >> > characters. There is no such problem with the compilation path in >> > English. The testing environment is Ubuntu 20.04. >> > I also tested having the compilation path include German and >> French >> > characters, and encountered the same compilation issues. >> > >> > Is this considered an issue? If it is, can it be added to the >> Java Bug >> > System? >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihse at openjdk.org Tue Dec 5 10:40:46 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 5 Dec 2023 10:40:46 GMT Subject: RFR: 8321373: Build should use LC_ALL=C.UTF-8 Message-ID: <9CbEPFCW69TrCZHAEYtPrOLDJdDyPN3NN6jjKzPhEv4=.e70c5204-28a4-4f42-814f-927dad42b8d4@github.com> We're currently setting LC_ALL=C. Not all tools will default to utf-8 as their encoding of choice when they see this locale, but use an arbitrarily encoding, which might not properly handle all UTF-8 characters. Since in practice, all our encoding is utf8, we should tell our tools this as well. This will at least have effect on how Java treats path names including unicode characters. ------------- Commit messages: - 8321373: Build should use LC_ALL=C.UTF-8 Changes: https://git.openjdk.org/jdk/pull/16971/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16971&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8321373 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/16971.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16971/head:pull/16971 PR: https://git.openjdk.org/jdk/pull/16971 From ihse at openjdk.org Tue Dec 5 11:21:36 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 5 Dec 2023 11:21:36 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: References: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> Message-ID: On Mon, 4 Dec 2023 22:14:14 GMT, Srinivas Vamsi Parasa wrote: >> Then you must add logic to check for this. Now the build will just fail if building with an older gcc. That is not acceptable. > > Hi Marcus (@magicus), please see the updated code which added guards to check for GCC version >= 7.5 in `src/java.base/linux/native/libsimdsort/{avx2-linux-qsort.cpp, avx512-linux-qsort.cpp}`. GCC >= 7.5 is needed to compile libsimdsort using C++17 features. Made sure that OpenJDK builds without errors using both GCC 7.5 and GCC 6.4. That sounds weird. You can't check for if compiler options should be enabled or not inside source code files. Are you saying that when compiling with GCC 6, it will just silently ignore `-std=c++17`? I'd have assumed that it printed a warning or error about an unknown or invalid option, if C++17 is not supported. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1415392615 From ihse at openjdk.org Tue Dec 5 11:25:33 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 5 Dec 2023 11:25:33 GMT Subject: RFR: 8321224: ct.sym for JDK 22 contains references to internal modules [v2] In-Reply-To: References: Message-ID: On Mon, 4 Dec 2023 21:27:57 GMT, Jan Lahoda wrote: >> As part of: >> https://github.com/openjdk/jdk/pull/16505 >> >> there are new symbol files for JDK 22, and @jddarcy noted the content looks weird. >> >> I was investigating, and found a few problems, some introduced by https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, some pre-existing. >> >> Note that https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b changed the way we generate `ct.sym` - it now contains `.sig` files also for the current JDK, not only for the past versions. Before this patch, `ct.sym` only contained a list of permitted modules for the current JDK, and the classfiles themselves were read from `lib/modules`. >> >> The problems (and their solution) I've attempted to tackle here: >> - since https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, the ct.sym accidentally includes all modules for the current release, including non-API/undocumented modules. The proposed solution is to pass the documented modules together with their transitive dependencies as a parameter when constructing ct.sym, then use them to only generate data for these modules. >> - there are tiny differences between the data that are in `ct.sym` and in the `.sym.txt` historical files, mostly around annotations. The `.sym.txt` files contain references to internal annotations (like `@PreviewFeature`), which are stripped or converted before the `.sig` file is written into `ct.sym`. When generating historical data for JDK N, we run `CreateSymbols` on JDK N, reading the JDK N classfiles, and producing `.sym.txt`. This is done using `--release N`, so that we read the correct span of modules. Sadly, since now `--release N` will always use the `.sig` files, we are loosing a little bit of information esp. around the annotations. The proposal here is to use `--release N` to read the list of modules to cover, and `--source N` to read the actual real classfiles from `lib/modules`. This should basically revert the behavior to the previous state. >> - this is an existing issue, but one that needs to be fixed. Sealed types are not written and read properly - writing was not storing them, and reading permitted subclasses was happening too late, not on the `header` line. Note that when fixing this, we now must store some of the non-exported elements, which are reachable through the permitted subclasses, so that casting works as expected. Also, since the historical record is incorrect here, I re-run the generator ... > > Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: > > Reflecting review feedback - keeping CT_TRANSITIVE_MODULES separate from CT_MODULES. Build changes look fine now. ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16942#pullrequestreview-1764783110 From fthevene at redhat.com Tue Dec 5 11:30:16 2023 From: fthevene at redhat.com (Frederic Thevenet) Date: Tue, 5 Dec 2023 12:30:16 +0100 Subject: [Proposal] Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll Message-ID: <2680b825-a017-47f4-8414-92ef5dadf9da@redhat.com> Hi, I would like to propose a small enhancement to the way the VersionInfo resources[1] embedded into native exes and dlls? on Windows are populated by the JDK build for its native components, and more specifically, the value for the property called "Company name". It is currently always the same as that of "vendor-name" but it It would be really useful to some build scenarios to allow for the "company name" property embedded in the VersionInfo compiled resources to be different from the "vendor name" property that is used within the JVM (e.g. java -version). So I'd like to propose the addition of? a "--with-jdk-rc-company-name" configure option which can be used to set "Company name" to its own value, independently of "'vendor-name", in the same fashion as the existing "--with-jdk-rc-name" can be used to override the values of "File description" and "Product name". If "--with-jdk-rc-company-name" isn't used, then the vendor-name value is used instead, reproducing the same behavior than without this patch. [1] https://learn.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource Cheers, -- Frederic Thevenet Senior Software Engineer - OpenJDK Red Hat France BAF5 C2D2 0BE0 1715 5EE1 0815 2065 AD47 B326 EB92 -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus.ihse.bursie at oracle.com Tue Dec 5 12:58:42 2023 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Tue, 5 Dec 2023 13:58:42 +0100 Subject: [Proposal] Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll In-Reply-To: <2680b825-a017-47f4-8414-92ef5dadf9da@redhat.com> References: <2680b825-a017-47f4-8414-92ef5dadf9da@redhat.com> Message-ID: <4b62dd64-a3c0-4656-a0c1-83b9038c08e3@oracle.com> On 2023-12-05 12:30, Frederic Thevenet wrote: > > Hi, > > I would like to propose a small enhancement to the way the VersionInfo > resources[1] embedded into native exes and dlls? on Windows are > populated by the JDK build for its native components, and more > specifically, the value for the property called "Company name". > > It is currently always the same as that of "vendor-name" but it It > would be really useful to some build scenarios to allow for the > "company name" property embedded in the VersionInfo compiled resources > to be different from the "vendor name" property that is used within > the JVM (e.g. java -version). > > So I'd like to propose the addition of? a "--with-jdk-rc-company-name" > configure option which can be used to set "Company name" to its own > value, independently of "'vendor-name", in the same fashion as the > existing "--with-jdk-rc-name" can be used to override the values of > "File description" and "Product name". > So this is really a "--with-jdk-rc-vendor-name", since it will use that value instead of --with-jdk-vendor-name for the RC fields in Windows binaries? Would --with-jdk-vendor-name be used for anything at all on Windows in that case? /Magnus > If "--with-jdk-rc-company-name" isn't used, then the vendor-name value > is used instead, reproducing the same behavior than without this patch. > > [1] > https://learn.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource > > Cheers, > > -- > Frederic Thevenet > Senior Software Engineer - OpenJDK > Red Hat France > BAF5 C2D2 0BE0 1715 5EE1 0815 2065 AD47 B326 EB92 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihse at openjdk.org Tue Dec 5 13:02:47 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 5 Dec 2023 13:02:47 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: On Fri, 1 Dec 2023 08:48:52 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: > > - Separate neon and sve functions into two source files > - Merge branch 'jdk:master' into JDK-8312425 > - Rename vmath to sleef in configure > - Address review comments in build system > - Add a bundled native lib in jdk as a bridge to libsleef > - Merge 'jdk:master' into JDK-8312425 > - Disable sleef by default > - Merge 'jdk:master' into JDK-8312425 > - 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF So you need to check both the flag and the header file? Oh well, then this is probably as good as it gets. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1840748314 From ihse at openjdk.org Tue Dec 5 13:05:48 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 5 Dec 2023 13:05:48 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: <9VeMdTAJPaPZDg9ZW7FVJOf9XGl4gGqAS-2g8SFc9c0=.36792cd5-66d9-4abc-ba0c-aee3478627f4@github.com> Message-ID: On Tue, 5 Dec 2023 07:21:32 GMT, Xiaohong Gong wrote: >> also, ideally, you will add the corresponding specific overrides like in ffi: >> >> AC_ARG_WITH(libffi-include, [AS_HELP_STRING([--with-libffi-include], >> [specify directory for the libffi include files])]) >> AC_ARG_WITH(libffi-lib, [AS_HELP_STRING([--with-libffi-lib], >> [specify directory for the libffi library])]) > > Thanks for the suggestion @magicus ! > > The check in current `lib-sleef.m4` is very common: > > - If user has specified libsleef root by '--with-libsleef', we assume it is the manually built sleef lib. So only `lib/` and `include/` is checked. And the flags are set based on that path. > - If user has not specified the libsleef root, and no `SYSROOT` is set, we try `PKG_CHECK` (like what you suggested) > - Otherwise, check `sleef.h` > - We assume the sleef module is installed under one of the valid system paths if the header can be found. So just linking with `-lsleef` will success. > > It's an issue in current flow like what @theRealAph met. I will add the options like `--with-libsleef-lib` and `--with-libsleef-include` like ffi. Regarding to extending the check for`--with-libsleef`, I think we can just make it simple like what it is now. Or, we have to check all the potential valid lib paths like `lib/`, `lib64/`, or maybe `lib/aarch64-linux-gnu`. The same to the `include` part. @theRealAph @magicus , WDYT? I'm fine with adding just --with-libsleef-lib and --with-libsleef-include to specify them directly. This makes it at least possible to use, if not overly convenient, for people using a system like Andrew's. If it annoys someone too much, we can extend it later. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1415576201 From fthevene at redhat.com Tue Dec 5 14:19:16 2023 From: fthevene at redhat.com (Frederic Thevenet) Date: Tue, 5 Dec 2023 15:19:16 +0100 Subject: [Proposal] Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll In-Reply-To: <4b62dd64-a3c0-4656-a0c1-83b9038c08e3@oracle.com> References: <2680b825-a017-47f4-8414-92ef5dadf9da@redhat.com> <4b62dd64-a3c0-4656-a0c1-83b9038c08e3@oracle.com> Message-ID: Hi Magnus, On 05/12/2023 13:58, Magnus Ihse Bursie wrote: > > So this is really a "--with-jdk-rc-vendor-name", since it will use > that value instead of --with-jdk-vendor-name for the RC fields in > Windows binaries? > I don't have a strong opinion about the name, only the target RC field in question is called "CompanyName", and this new option would only be used to set this property, so referencing to this instead of the term "vendor" made maybe more sense to me. > Would --with-jdk-vendor-name be used for anything at all on Windows in > that case? > I can't find any references to an existing "--with-jdk-vendor-name" so I assume than you meant "--wtih-vendor-name", is that correct? If so, yes; "--with-vendor-name" would still be used for the same things than it currently is, with the exception of populating the "CompanyName" RC field *if* "--with-jdk-rc-vendor/company-name" is also used. -- Frederic Thevenet Senior Software Engineer - OpenJDK Red Hat France BAF5 C2D2 0BE0 1715 5EE1 0815 2065 AD47 B326 EB92 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fthevene at redhat.com Tue Dec 5 14:24:16 2023 From: fthevene at redhat.com (Frederic Thevenet) Date: Tue, 5 Dec 2023 15:24:16 +0100 Subject: [Proposal] Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll In-Reply-To: References: <2680b825-a017-47f4-8414-92ef5dadf9da@redhat.com> <4b62dd64-a3c0-4656-a0c1-83b9038c08e3@oracle.com> Message-ID: <9360b600-f5f5-4d8d-979c-f58a3e267581@redhat.com> To maybe clarify things a bit; the idea here is to allow for different values for the CompanyName RC field and the rest of the places where "vendor-name" is currently used. You may be wondering why? The TL:DR is; we aim to make it easier to do a binary comparison between builds from the same source but from different vendors. Now there are of course a lot of things that need to happen before this even matters (like aligning the native tool chains, bootjdks, etc..), but because differences in the compiled resources for an otherwise identically produced binary on Windows will cause the CRC in the PE header to change, this means that all native binaries resulting from will have significant differences that are difficult to account for. There is only one RC field that is typically different in two builds of the same sources by two different vendors, and it is "CompanyName ", and as a matter of fact, it is of very little use: both users and java programs will query the java.vendor property to get this info, and if one's goal is to verify the provenance of a single binary file, then the name of signer from the digital signature on that file is far more reliable, as it is not so easily forged. So having the option to set this value to something generic enough that it can be the same across different vendors (should they want to) - while keeping all of other the usage or "vendor-name" as they are now - seems like a good way of solving that particular problem. Of course, the comparison process still needs to account for differences in the vendor strings (but that now only affects jvm.dll, instead of every single exe and dll) as the different digital signatures (but these can be easily stripped before comparing). This is just our own reason for having this as an option, but it could probably prove useful in other situations too. On 05/12/2023 15:19, Frederic Thevenet wrote: > Hi Magnus, > > > On 05/12/2023 13:58, Magnus Ihse Bursie wrote: >> >> So this is really a "--with-jdk-rc-vendor-name", since it will use >> that value instead of --with-jdk-vendor-name for the RC fields in >> Windows binaries? >> > I don't have a strong opinion about the name, only the target RC field > in question is called "CompanyName", and this new option would only be > used to set this property, so referencing to this instead of the term > "vendor" made maybe more sense to me. > >> Would --with-jdk-vendor-name be used for anything at all on Windows >> in that case? >> > > I can't find any references to an existing "--with-jdk-vendor-name" so > I assume than you meant "--wtih-vendor-name", is that correct? > > If so, yes; "--with-vendor-name" would still be used for the same > things than it currently is, with the exception of populating the > "CompanyName" RC field *if* "--with-jdk-rc-vendor/company-name" is > also used. -- Frederic Thevenet Senior Software Engineer - OpenJDK Red Hat France BAF5 C2D2 0BE0 1715 5EE1 0815 2065 AD47 B326 EB92 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jlahoda at openjdk.org Tue Dec 5 16:27:30 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 5 Dec 2023 16:27:30 GMT Subject: RFR: 8321224: ct.sym for JDK 22 contains references to internal modules [v3] In-Reply-To: References: Message-ID: > As part of: > https://github.com/openjdk/jdk/pull/16505 > > there are new symbol files for JDK 22, and @jddarcy noted the content looks weird. > > I was investigating, and found a few problems, some introduced by https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, some pre-existing. > > Note that https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b changed the way we generate `ct.sym` - it now contains `.sig` files also for the current JDK, not only for the past versions. Before this patch, `ct.sym` only contained a list of permitted modules for the current JDK, and the classfiles themselves were read from `lib/modules`. > > The problems (and their solution) I've attempted to tackle here: > - since https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, the ct.sym accidentally includes all modules for the current release, including non-API/undocumented modules. The proposed solution is to pass the documented modules together with their transitive dependencies as a parameter when constructing ct.sym, then use them to only generate data for these modules. > - there are tiny differences between the data that are in `ct.sym` and in the `.sym.txt` historical files, mostly around annotations. The `.sym.txt` files contain references to internal annotations (like `@PreviewFeature`), which are stripped or converted before the `.sig` file is written into `ct.sym`. When generating historical data for JDK N, we run `CreateSymbols` on JDK N, reading the JDK N classfiles, and producing `.sym.txt`. This is done using `--release N`, so that we read the correct span of modules. Sadly, since now `--release N` will always use the `.sig` files, we are loosing a little bit of information esp. around the annotations. The proposal here is to use `--release N` to read the list of modules to cover, and `--source N` to read the actual real classfiles from `lib/modules`. This should basically revert the behavior to the previous state. > - this is an existing issue, but one that needs to be fixed. Sealed types are not written and read properly - writing was not storing them, and reading permitted subclasses was happening too late, not on the `header` line. Note that when fixing this, we now must store some of the non-exported elements, which are reachable through the permitted subclasses, so that casting works as expected. Also, since the historical record is incorrect here, I re-run the generator for JDK 17-21 (as sealed c... Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: - Removing unneeded exports. - Merge branch 'master' into JDK-8321224 - Reflecting review feedback - keeping CT_TRANSITIVE_MODULES separate from CT_MODULES. - Removing trailing whitespace. - Ensuring qualified packages are recorded properly. - Fixing tests. - Adding a way to dump the API. - Adding missing file. - 8321224: ct.sym for JDK 22 contains references to internal modules ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16942/files - new: https://git.openjdk.org/jdk/pull/16942/files/87927789..ce981117 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16942&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16942&range=01-02 Stats: 56068 lines in 1520 files changed: 31819 ins; 18328 del; 5921 mod Patch: https://git.openjdk.org/jdk/pull/16942.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16942/head:pull/16942 PR: https://git.openjdk.org/jdk/pull/16942 From jlahoda at openjdk.org Tue Dec 5 17:27:48 2023 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 5 Dec 2023 17:27:48 GMT Subject: Integrated: 8321224: ct.sym for JDK 22 contains references to internal modules In-Reply-To: References: Message-ID: On Sun, 3 Dec 2023 21:31:42 GMT, Jan Lahoda wrote: > As part of: > https://github.com/openjdk/jdk/pull/16505 > > there are new symbol files for JDK 22, and @jddarcy noted the content looks weird. > > I was investigating, and found a few problems, some introduced by https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, some pre-existing. > > Note that https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b changed the way we generate `ct.sym` - it now contains `.sig` files also for the current JDK, not only for the past versions. Before this patch, `ct.sym` only contained a list of permitted modules for the current JDK, and the classfiles themselves were read from `lib/modules`. > > The problems (and their solution) I've attempted to tackle here: > - since https://github.com/openjdk/jdk/commit/fc314740e947b2338ab9e4d4fce0c4f52de56c4b, the ct.sym accidentally includes all modules for the current release, including non-API/undocumented modules. The proposed solution is to pass the documented modules together with their transitive dependencies as a parameter when constructing ct.sym, then use them to only generate data for these modules. > - there are tiny differences between the data that are in `ct.sym` and in the `.sym.txt` historical files, mostly around annotations. The `.sym.txt` files contain references to internal annotations (like `@PreviewFeature`), which are stripped or converted before the `.sig` file is written into `ct.sym`. When generating historical data for JDK N, we run `CreateSymbols` on JDK N, reading the JDK N classfiles, and producing `.sym.txt`. This is done using `--release N`, so that we read the correct span of modules. Sadly, since now `--release N` will always use the `.sig` files, we are loosing a little bit of information esp. around the annotations. The proposal here is to use `--release N` to read the list of modules to cover, and `--source N` to read the actual real classfiles from `lib/modules`. This should basically revert the behavior to the previous state. > - this is an existing issue, but one that needs to be fixed. Sealed types are not written and read properly - writing was not storing them, and reading permitted subclasses was happening too late, not on the `header` line. Note that when fixing this, we now must store some of the non-exported elements, which are reachable through the permitted subclasses, so that casting works as expected. Also, since the historical record is incorrect here, I re-run the generator for JDK 17-21 (as sealed c... This pull request has now been integrated. Changeset: 18c79227 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/18c7922781536366be93b2478251e32e261d06bb Stats: 26870 lines in 194 files changed: 6101 ins; 20256 del; 513 mod 8321224: ct.sym for JDK 22 contains references to internal modules Reviewed-by: darcy, vromero, asotona, ihse ------------- PR: https://git.openjdk.org/jdk/pull/16942 From duke at openjdk.org Tue Dec 5 17:28:39 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Tue, 5 Dec 2023 17:28:39 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: References: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> Message-ID: On Tue, 5 Dec 2023 11:19:00 GMT, Magnus Ihse Bursie wrote: >> Hi Marcus (@magicus), please see the updated code which added guards to check for GCC version >= 7.5 in `src/java.base/linux/native/libsimdsort/{avx2-linux-qsort.cpp, avx512-linux-qsort.cpp}`. GCC >= 7.5 is needed to compile libsimdsort using C++17 features. Made sure that OpenJDK builds without errors using both GCC 7.5 and GCC 6.4. > > That sounds weird. You can't check for if compiler options should be enabled or not inside source code files. > > Are you saying that when compiling with GCC 6, it will just silently ignore `-std=c++17`? I'd have assumed that it printed a warning or error about an unknown or invalid option, if C++17 is not supported. Hi Magnus (@magicus), > Are you saying that when compiling with GCC 6, it will just silently ignore `-std=c++17`? I'd have assumed that it printed a warning or error about an unknown or invalid option, if C++17 is not supported. The GCC complier for versions 6 (and even 5) silently ignores the flag `-std=c++17`. It does not print any warning or error. I tested it with a toy C++ program and also by building OpenJDK using GCC 6. > You can't check for if compiler options should be enabled or not inside source code files. what I meant was, there are #ifdef guards using predefined macros in the C++ source code to check for GCC version and make the simdsort code available for compilation or not based on the GCC version // src/java.base/linux/native/libsimdsort/simdsort-support.hpp #if defined(_LP64) && (defined(__GNUC__) && ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 5)))) #define __SIMDSORT_SUPPORTED_LINUX #endif //src/java.base/linux/native/libsimdsort/avx2-linux-qsort.cpp #include "simdsort-support.hpp" #ifdef __SIMDSORT_SUPPORTED_LINUX #endif ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1416037340 From jbhateja at openjdk.org Tue Dec 5 19:22:49 2023 From: jbhateja at openjdk.org (Jatin Bhateja) Date: Tue, 5 Dec 2023 19:22:49 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> References: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> Message-ID: On Mon, 4 Dec 2023 22:15:24 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision: > > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - add GCC version guards > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - Remove C++17 from C flags > - add avoid masked stores operation > - update the code to check for supported simd sort cpus > - Disable AVX2 sort for 64-bit types > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - fix jcheck failures due to windows encoding > - fix carriage return and change insertion sort thresholds > - ... and 7 more: https://git.openjdk.org/jdk/compare/fc7d33f2...bc590d9f src/java.base/linux/native/libsimdsort/avx2-linux-qsort.cpp line 50: > 48: case JVM_T_DOUBLE: > 49: avx2_fast_sort((double*)array, from_index, to_index, INSERTION_SORT_THRESHOLD_64BIT); > 50: break; Please add safe assertions for missing types. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1416173543 From jbhateja at openjdk.org Tue Dec 5 19:47:49 2023 From: jbhateja at openjdk.org (Jatin Bhateja) Date: Tue, 5 Dec 2023 19:47:49 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> References: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> Message-ID: On Mon, 4 Dec 2023 22:15:24 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision: > > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - add GCC version guards > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - Remove C++17 from C flags > - add avoid masked stores operation > - update the code to check for supported simd sort cpus > - Disable AVX2 sort for 64-bit types > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - fix jcheck failures due to windows encoding > - fix carriage return and change insertion sort thresholds > - ... and 7 more: https://git.openjdk.org/jdk/compare/021f5063...bc590d9f src/java.base/linux/native/libsimdsort/avx2-emu-funcs.hpp line 64: > 62: } > 63: return lut; > 64: }(); Lut64 is needed for compress64 emulation, can be removed. src/java.base/linux/native/libsimdsort/avx2-emu-funcs.hpp line 234: > 232: > 233: vtype::mask_storeu(leftStore, left, temp); > 234: } Can be removed if not being used. src/java.base/linux/native/libsimdsort/avx2-emu-funcs.hpp line 277: > 275: > 276: return _mm_popcnt_u32(shortMask); > 277: } Can be removed if not being used. src/java.base/linux/native/libsimdsort/avx2-linux-qsort.cpp line 44: > 42: break; > 43: case JVM_T_FLOAT: > 44: avx2_fast_sort((float*)array, from_index, to_index, INSERTION_SORT_THRESHOLD_32BIT); Assertions for unsupported types. src/java.base/linux/native/libsimdsort/avx2-linux-qsort.cpp line 56: > 54: case JVM_T_FLOAT: > 55: avx2_fast_partition((float*)array, from_index, to_index, pivot_indices, index_pivot1, index_pivot2); > 56: break; Please add assertion for unsupported types. src/java.base/linux/native/libsimdsort/avx512-32bit-qsort.hpp line 235: > 233: return avx512_double_compressstore>( > 234: left_addr, right_addr, k, reg); > 235: } Can be removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1416191049 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1416186096 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1416186814 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1416189371 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1416189115 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1416187350 From erikj at openjdk.org Wed Dec 6 00:27:33 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Wed, 6 Dec 2023 00:27:33 GMT Subject: RFR: 8321373: Build should use LC_ALL=C.UTF-8 In-Reply-To: <9CbEPFCW69TrCZHAEYtPrOLDJdDyPN3NN6jjKzPhEv4=.e70c5204-28a4-4f42-814f-927dad42b8d4@github.com> References: <9CbEPFCW69TrCZHAEYtPrOLDJdDyPN3NN6jjKzPhEv4=.e70c5204-28a4-4f42-814f-927dad42b8d4@github.com> Message-ID: On Tue, 5 Dec 2023 10:35:05 GMT, Magnus Ihse Bursie wrote: > We're currently setting LC_ALL=C. Not all tools will default to utf-8 as their encoding of choice when they see this locale, but use an arbitrarily encoding, which might not properly handle all UTF-8 characters. Since in practice, all our encoding is utf8, we should tell our tools this as well. > > This will at least have effect on how Java treats path names including unicode characters. I think this is ok, but would feel more at ease if you had run through all our internal builds and done compare builds with the patch. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16971#issuecomment-1841871611 From xgong at openjdk.org Wed Dec 6 01:29:42 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Wed, 6 Dec 2023 01:29:42 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: On Tue, 5 Dec 2023 13:00:04 GMT, Magnus Ihse Bursie wrote: > So you need to check both the flag and the header file? Oh well, then this is probably as good as it gets. Yes, we have to check both the flag and the header file. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1841926432 From xgong at openjdk.org Wed Dec 6 09:15:05 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Wed, 6 Dec 2023 09:15:05 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v5] In-Reply-To: References: <9VeMdTAJPaPZDg9ZW7FVJOf9XGl4gGqAS-2g8SFc9c0=.36792cd5-66d9-4abc-ba0c-aee3478627f4@github.com> Message-ID: <81tcSvaI8RdngSM-Nq051Vwl81u9NyEgVr8BCV44KYw=.74051087-23af-441f-825a-83dfa70c9426@github.com> On Tue, 5 Dec 2023 13:03:22 GMT, Magnus Ihse Bursie wrote: >> Thanks for the suggestion @magicus ! >> >> The check in current `lib-sleef.m4` is very common: >> >> - If user has specified libsleef root by '--with-libsleef', we assume it is the manually built sleef lib. So only `lib/` and `include/` is checked. And the flags are set based on that path. >> - If user has not specified the libsleef root, and no `SYSROOT` is set, we try `PKG_CHECK` (like what you suggested) >> - Otherwise, check `sleef.h` >> - We assume the sleef module is installed under one of the valid system paths if the header can be found. So just linking with `-lsleef` will success. >> >> It's an issue in current flow like what @theRealAph met. I will add the options like `--with-libsleef-lib` and `--with-libsleef-include` like ffi. Regarding to extending the check for`--with-libsleef`, I think we can just make it simple like what it is now. Or, we have to check all the potential valid lib paths like `lib/`, `lib64/`, or maybe `lib/aarch64-linux-gnu`. The same to the `include` part. @theRealAph @magicus , WDYT? > > I'm fine with adding just --with-libsleef-lib and --with-libsleef-include to specify them directly. This makes it at least possible to use, if not overly convenient, for people using a system like Andrew's. If it annoys someone too much, we can extend it later. Added these two options in latest commit. Thanks! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1416962901 From xgong at openjdk.org Wed Dec 6 09:14:58 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Wed, 6 Dec 2023 09:14:58 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v7] In-Reply-To: References: Message-ID: > Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). > > SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. > > To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. > > Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. > > [1] https://github.com/openjdk/jdk/pull/3638 > [2] https://sleef.org/ > [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ > [4] https://packages.debian.org/bookworm/libsleef3 > [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: Add "--with-libsleef-lib" and "--with-libsleef-include" options ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16234/files - new: https://git.openjdk.org/jdk/pull/16234/files/ee5caf6d..f3ff0672 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16234&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16234&range=05-06 Stats: 124 lines in 3 files changed: 67 ins; 33 del; 24 mod Patch: https://git.openjdk.org/jdk/pull/16234.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16234/head:pull/16234 PR: https://git.openjdk.org/jdk/pull/16234 From xgong at openjdk.org Wed Dec 6 09:15:03 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Wed, 6 Dec 2023 09:15:03 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: Message-ID: On Fri, 1 Dec 2023 16:26:02 GMT, Magnus Ihse Bursie wrote: >> Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision: >> >> - Separate neon and sve functions into two source files >> - Merge branch 'jdk:master' into JDK-8312425 >> - Rename vmath to sleef in configure >> - Address review comments in build system >> - Add a bundled native lib in jdk as a bridge to libsleef >> - Merge 'jdk:master' into JDK-8312425 >> - Disable sleef by default >> - Merge 'jdk:master' into JDK-8312425 >> - 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF > > doc/building.md line 639: > >> 637: >> 638: libsleef, the [SIMD Library for Evaluating Elementary Functions]( >> 639: https://sleef.org/) is required when building libvmath.so on Linux/aarch64 > > This is incorrect. The library is not required, but if it is present, we will build libvmath with it. > > Edit: Or rather, this is misleading. Technically it is correct, since you state that it is required when building libvmath.so, but it is easy to mistake for being required for building the JDK. The reader presumably does not know what libvmath.so is or how it is used. > > Please rephrase this to so that it is clear that this is optional, but will provide performance benefits to the resulting JDK if present. You do not need to mention libvmath.so here, for no other dependency do we declare what parts of the JDK that require it -- it is not essential for this document. > > Also see if you can make this paragraph and the one at the end be a bit more tighter, not the last paragraph seems to be both repeat and contradict this one. Hi @magicus , the doc is updated. Thanks for your comment on this! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1416964362 From sakyosang at gmail.com Wed Dec 6 09:39:05 2023 From: sakyosang at gmail.com (last last) Date: Wed, 6 Dec 2023 17:39:05 +0800 Subject: Compile Errors in OpenJDK 11 with Non-English Characters in Compilation Path In-Reply-To: References: <5b3c1d56-e1e1-4afd-a117-e1e9af6ac73a@oracle.com> Message-ID: The pull request at https://github.com/openjdk/jdk/pull/16971/files has effectively addressed the issue I was facing. Thank you for your time and effort in addressing this matter? Magnus Ihse Bursie ?2023?12?5??? 18:36??? > On closer inspection, it would probably be more prudential to set the > value of LC_ALL to C.UTF-8 in the build. It will likely help you with your > problem. I have published a PR at > https://github.com/openjdk/jdk/pull/16971 (JDK-8321373). > > /Magnus > On 2023-11-24 13:08, Magnus Ihse Bursie wrote: > > Are you running on Ubuntu properly, or Ubuntu in WLS? If it is the former, > the it is not the same problem as the other poster, which were running on > Windows. > > The JDK build uses the "C" locale. This should be set automatically by the > build system, so it should just work. But in case there is some bug, try > exporting LC_ALL=C before building and see if it helps. > > Also, the point of LC_ALL is that you can specify it instead of all the > detailed LC_* variables... > > /Magnus > On 2023-11-24 08:41, last last wrote: > > I am currently facing the same error when build paths include Chinese > characters ,after setting the environment variable "export > LC_ALL=zh_CN.UTF-8" .The testing environment is also Ubuntu 2004. > The system locale settings are as follows: LANG=zh_CN.UTF-8 > LANGUAGE=zh_CN:zh LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" > LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" > LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" > LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" > LC_MEASUREMENT="zh_CN.UTF-8" LC_IDENTIFICATION="zh_CN.UTF-8" > LC_ALL=zh_CN.UTF-8 > I'm wondering if there are any other system configurations that could help > resolve this problem. Your insights would be greatly appreciated. > > Magnus Ihse Bursie ?2023?11?23??? 22:30??? > >> Congratulations! You get to test drive the recently updated build >> instructions for Windows locale requirements! :-) >> >> Please see >> >> https://github.com/openjdk/jdk/blob/master/doc/building.md#locale-requirements >> >> In particular, I believe you need to set your system locale. >> >> Please report back if that solves the problem or not. >> >> /Magnus >> >> >> On 2023-11-23 03:51, last last wrote: >> > Hi all, >> > >> > I tried to build a OpenJDK11 fastdebug with paths that include Chinese >> > characters?my build path is "/home/kylin/??/jdk11u-dev"?but i saw some >> > error as followings: >> > >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > make[3]: *** [ToolsLangtools.gmk:40: >> > >> /home/kylin/??/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch] >> >> > Error 1 >> > make[2]: *** [make/Main.gmk:73: buildtools-langtools] Error 2 >> > make[2]: *** Waiting for unfinished jobs.... >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/tools/jvmti/_the.BUILD_JVMTI_TOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > make[3]: *** [gensrc/GensrcJvmti.gmk:45: >> > >> /home/kylin/??/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/tools/jvmti/_the.BUILD_JVMTI_TOOLS_batch] >> >> > Error 1 >> > make[3]: *** Waiting for unfinished jobs.... >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/buildtools/tools_classes/_the.BUILD_JFR_TOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > make[3]: *** [gensrc/GensrcJfr.gmk:43: >> > >> /home/kylin/??/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/buildtools/tools_classes/_the.BUILD_JFR_TOOLS_batch] >> >> > Error 1 >> > make[2]: *** [make/Main.gmk:265: hotspot-server-gensrc] Error 2 >> > >> > ERROR: Build failed for target 'images' in configuration >> > 'linux-aarch64-normal-server-fastdebug' (exit code 2) >> > >> > === Output from failing command(s) repeated here === >> > * For target >> > buildtools_langtools_tools_classes__the.BUILD_TOOLS_LANGTOOLS_batch: >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > * For target >> > >> hotspot_variant-server_buildtools_tools_classes__the.BUILD_JFR_TOOLS_batch: >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/buildtools/tools_classes/_the.BUILD_JFR_TOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > * For target >> > hotspot_variant-server_tools_jvmti__the.BUILD_JVMTI_TOOLS_batch: >> > Exception in thread "main" java.nio.file.InvalidPathException: >> > Malformed input or input contains unmappable characters: >> > >> /home/kylin/??????/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/hotspot/variant-server/tools/jvmti/_the.BUILD_JVMTI_TOOLS_batch.tmp >> > at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145) >> > at java.base/sun.nio.fs.UnixPath.(UnixPath.java:69) >> > at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:279) >> > at java.base/java.nio.file.Path.of(Path.java:147) >> > at java.base/java.nio.file.Paths.get(Paths.java:69) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:128) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102) >> > at >> > >> jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215) >> > at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170) >> > at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) >> > at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) >> > >> > * All command lines available in >> > >> /home/kylin/??/jdk11u-dev/build/linux-aarch64-normal-server-fastdebug/make-support/failure-logs. >> > >> > ---------- >> > This error only arises when the compilation path contains Chinese >> > characters. There is no such problem with the compilation path in >> > English. The testing environment is Ubuntu 20.04. >> > I also tested having the compilation path include German and French >> > characters, and encountered the same compilation issues. >> > >> > Is this considered an issue? If it is, can it be added to the Java Bug >> > System? >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihse at openjdk.org Wed Dec 6 11:48:44 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 6 Dec 2023 11:48:44 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v7] In-Reply-To: References: Message-ID: <0ya82eFBzsE0U96QMoP7OKmd7PAvW7GFXYP_iD_HTqE=.f12ca572-4a4e-4fbd-947b-e11f0aad81a1@github.com> On Wed, 6 Dec 2023 09:14:58 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: > > Add "--with-libsleef-lib" and "--with-libsleef-include" options make/modules/jdk.incubator.vector/Lib.gmk line 45: > 43: $(eval $(call SetupJdkLibrary, BUILD_LIBVMATH, \ > 44: NAME := vmath, \ > 45: CFLAGS := $(CFLAGS_JDKLIB) $(LIBSLEEF_CFLAGS) -fvisibility=default, \ Why `-fvisibility=default`? (Sorry, only noticed this now) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1417156921 From ihse at openjdk.org Wed Dec 6 11:53:42 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 6 Dec 2023 11:53:42 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v7] In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 09:14:58 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: > > Add "--with-libsleef-lib" and "--with-libsleef-include" options All the makefile changes we've discussed previously now look good. However, I just noticed the additional -f flag. Why are you not exporting the functions from source code instead? That is the way we normally do it in JDK libraries. In your case, it seems like you only need to add the export to the macro. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1842720243 From ihse at openjdk.org Wed Dec 6 12:02:42 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 6 Dec 2023 12:02:42 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> References: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> Message-ID: On Mon, 4 Dec 2023 22:15:24 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision: > > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - add GCC version guards > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - Remove C++17 from C flags > - add avoid masked stores operation > - update the code to check for supported simd sort cpus > - Disable AVX2 sort for 64-bit types > - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort > - fix jcheck failures due to windows encoding > - fix carriage return and change insertion sort thresholds > - ... and 7 more: https://git.openjdk.org/jdk/compare/dbbc5f0a...bc590d9f Build changes look fine. You will still need the usual 2 reviewers from hotspot. ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16534#pullrequestreview-1767374468 From ihse at openjdk.org Wed Dec 6 12:02:43 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 6 Dec 2023 12:02:43 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: References: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> Message-ID: <7_T6sM3wjbSzZ0ab9FsptbpPnlQ2J4NNctQNkdbDFdI=.b595a8cc-4b14-44c6-8319-00e68fea21c3@github.com> On Tue, 5 Dec 2023 17:26:06 GMT, Srinivas Vamsi Parasa wrote: >> That sounds weird. You can't check for if compiler options should be enabled or not inside source code files. >> >> Are you saying that when compiling with GCC 6, it will just silently ignore `-std=c++17`? I'd have assumed that it printed a warning or error about an unknown or invalid option, if C++17 is not supported. > > Hi Magnus (@magicus), > >> Are you saying that when compiling with GCC 6, it will just silently ignore `-std=c++17`? I'd have assumed that it printed a warning or error about an unknown or invalid option, if C++17 is not supported. > > The GCC complier for versions 6 (and even 5) silently ignores the flag `-std=c++17`. It does not print any warning or error. I tested it with a toy C++ program and also by building OpenJDK using GCC 6. > >> You can't check for if compiler options should be enabled or not inside source code files. > > what I meant was, there are #ifdef guards using predefined macros in the C++ source code to check for GCC version and make the simdsort code available for compilation or not based on the GCC version > > > // src/java.base/linux/native/libsimdsort/simdsort-support.hpp > #if defined(_LP64) && (defined(__GNUC__) && ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 5)))) > #define __SIMDSORT_SUPPORTED_LINUX > #endif > > > > //src/java.base/linux/native/libsimdsort/avx2-linux-qsort.cpp > #include "simdsort-support.hpp" > #ifdef __SIMDSORT_SUPPORTED_LINUX > > #endif Okay, then I guess I am fine with this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417170882 From aph-open at littlepinkcloud.com Wed Dec 6 12:18:23 2023 From: aph-open at littlepinkcloud.com (Andrew Haley) Date: Wed, 6 Dec 2023 12:18:23 +0000 Subject: Cross compilation discussion In-Reply-To: References: Message-ID: On 11/29/23 14:31, erik.joelsson at oracle.com wrote: > Perhaps what we need to do is separate the notion of needing a separate > BUILD_JDK from the notion of cross compiling. Isn't that what --with-sysroot= usually means? In that case, you're building against an incompatible set of libraries. By definition, because if you're building against a compatible set of libraries you don't have a different sysroot. -- Andrew Haley (he/him) Java Platform Lead Engineer Red Hat UK Ltd. https://keybase.io/andrewhaley EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671 From ihse at openjdk.org Wed Dec 6 12:33:32 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 6 Dec 2023 12:33:32 GMT Subject: RFR: 8321373: Build should use LC_ALL=C.UTF-8 In-Reply-To: <9CbEPFCW69TrCZHAEYtPrOLDJdDyPN3NN6jjKzPhEv4=.e70c5204-28a4-4f42-814f-927dad42b8d4@github.com> References: <9CbEPFCW69TrCZHAEYtPrOLDJdDyPN3NN6jjKzPhEv4=.e70c5204-28a4-4f42-814f-927dad42b8d4@github.com> Message-ID: On Tue, 5 Dec 2023 10:35:05 GMT, Magnus Ihse Bursie wrote: > We're currently setting LC_ALL=C. Not all tools will default to utf-8 as their encoding of choice when they see this locale, but use an arbitrarily encoding, which might not properly handle all UTF-8 characters. Since in practice, all our encoding is utf8, we should tell our tools this as well. > > This will at least have effect on how Java treats path names including unicode characters. I'll make such a run. But I discovered now that C.UTF-8 is not available on (some?) macs, so I guess I'll need to add a configure check to determine if we should use C or C.UTF-8. The latter is the norm on Linux nowadays (or, to be precise, locales should in general be specified as `.UTF-8`). ------------- PR Comment: https://git.openjdk.org/jdk/pull/16971#issuecomment-1842772271 From erik.joelsson at oracle.com Wed Dec 6 14:35:07 2023 From: erik.joelsson at oracle.com (erik.joelsson at oracle.com) Date: Wed, 6 Dec 2023 06:35:07 -0800 Subject: Cross compilation discussion In-Reply-To: References: Message-ID: On 12/6/23 04:18, Andrew Haley wrote: > On 11/29/23 14:31, erik.joelsson at oracle.com wrote: >> Perhaps what we need to do is separate the notion of needing a separate >> BUILD_JDK from the notion of cross compiling. > > Isn't that what --with-sysroot= usually means? In that case, you're > building against an incompatible set of libraries. By definition, > because if you're building against a compatible set of libraries you > don't have a different sysroot. > No, that is not always the case, and was the point of my previous email. When we build the JDK at Oracle, we provide a sysroot of an older Linux version (the least common denominator for all our support Linux distros/versions). The goal is to produce a single JDK distribution that works on all our support Linux versions. Today we run the build on OL8 and "cross compile" it to OL6 using a devkit/sysroot. The JDK produced is compatible with OL6, OL7, OL8 and OL9. Because of this we haven't considered it a cross compilation setup, while it does have some aspects of cross compiling. There is however no need to deal with a separate BUILD_JDK in this scenario. Also the build, host and target tuples in autoconf are the same. /Erik From aph-open at littlepinkcloud.com Wed Dec 6 14:46:40 2023 From: aph-open at littlepinkcloud.com (Andrew Haley) Date: Wed, 6 Dec 2023 14:46:40 +0000 Subject: Cross compilation discussion In-Reply-To: References: Message-ID: <789dcb6f-e326-4be6-ba49-0e50e9251e98@littlepinkcloud.com> On 12/6/23 14:35, erik.joelsson at oracle.com wrote: > On 12/6/23 04:18, Andrew Haley wrote: >> On 11/29/23 14:31, erik.joelsson at oracle.com wrote: >>> Perhaps what we need to do is separate the notion of needing a separate >>> BUILD_JDK from the notion of cross compiling. >> >> Isn't that what --with-sysroot= usually means? In that case, you're >> building against an incompatible set of libraries. By definition, >> because if you're building against a compatible set of libraries you >> don't have a different sysroot. >> > No, that is not always the case, and was the point of my previous email. > When we build the JDK at Oracle, we provide a sysroot of an older Linux > version (the least common denominator for all our support Linux > distros/versions). The goal is to produce a single JDK distribution that > works on all our support Linux versions. Today we run the build on OL8 > and "cross compile" it to OL6 using a devkit/sysroot. The JDK produced > is compatible with OL6, OL7, OL8 and OL9. Because of this we haven't > considered it a cross compilation setup, while it does have some aspects > of cross compiling. There is however no need to deal with a separate > BUILD_JDK in this scenario. Also the build, host and target tuples in > autoconf are the same. OK. So you are doing what I'd usually call cross compiling, sort of, but you don't want to treat it as a cross-compiled build. It's an unusual case, in that it is cross compiled, but it is also expected to be able to run on the build system. -- Andrew Haley (he/him) Java Platform Lead Engineer Red Hat UK Ltd. https://keybase.io/andrewhaley EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671 From fthevenet at openjdk.org Wed Dec 6 15:10:52 2023 From: fthevenet at openjdk.org (Frederic Thevenet) Date: Wed, 6 Dec 2023 15:10:52 GMT Subject: RFR: 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll Message-ID: When building OpenJDK on the Windows platform, version information are embedded as compiled resources into every native library and executable, which typically contain version numbers, copyright information, product name and vendor name (called "Company name" in this context). Currently, the value for "Company name" is always the same as that of "vendor-name" but it It would be really useful to some build scenarios to allow for the "company name" property embedded in the VersionInfo compiled resources to be different from the "vendor name" property that is used within the JVM (e.g. java -version). This PR adds a "--with-jdk-rc-company-name" configure option which can be used to set "Company name" to its own value, independently of "'vendor-name", in the same fashion as the existing "--with-jdk-rc-name", used to override the values of "File description" and "Product name". If "--with-jdk-rc-company-name" isn't used, then the vendor-name value is used instead, reproducing the same behavior than without this patch. ------------- Commit messages: - 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll Changes: https://git.openjdk.org/jdk/pull/16972/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16972&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8321374 Stats: 11 lines in 3 files changed: 10 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/16972.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16972/head:pull/16972 PR: https://git.openjdk.org/jdk/pull/16972 From fthevenet at openjdk.org Wed Dec 6 15:10:53 2023 From: fthevenet at openjdk.org (Frederic Thevenet) Date: Wed, 6 Dec 2023 15:10:53 GMT Subject: RFR: 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll In-Reply-To: References: Message-ID: On Tue, 5 Dec 2023 11:15:18 GMT, Frederic Thevenet wrote: > When building OpenJDK on the Windows platform, version information are embedded as compiled resources into every native library and executable, which typically contain version numbers, copyright information, product name and vendor name (called "Company name" in this context). > > Currently, the value for "Company name" is always the same as that of "vendor-name" but it It would be really useful to some build scenarios to allow for the "company name" property embedded in the VersionInfo compiled resources to be different from the "vendor name" property that is used within the JVM (e.g. java -version). > > This PR adds a "--with-jdk-rc-company-name" configure option which can be used to set "Company name" to its own value, independently of "'vendor-name", in the same fashion as the existing "--with-jdk-rc-name", used to override the values of "File description" and "Product name". > > If "--with-jdk-rc-company-name" isn't used, then the vendor-name value is used instead, reproducing the same behavior than without this patch. NB: Test "GathererTest::testMassivelyComposedGatherers" in tier1 on linux-86 is failing for reasons unrelated to this PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16972#issuecomment-1843058806 From duke at openjdk.org Wed Dec 6 17:16:50 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 17:16:50 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: References: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> Message-ID: On Tue, 5 Dec 2023 19:33:48 GMT, Jatin Bhateja wrote: >> Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision: >> >> - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort >> - add GCC version guards >> - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort >> - Remove C++17 from C flags >> - add avoid masked stores operation >> - update the code to check for supported simd sort cpus >> - Disable AVX2 sort for 64-bit types >> - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort >> - fix jcheck failures due to windows encoding >> - fix carriage return and change insertion sort thresholds >> - ... and 7 more: https://git.openjdk.org/jdk/compare/d8b29378...bc590d9f > > src/java.base/linux/native/libsimdsort/avx512-32bit-qsort.hpp line 235: > >> 233: return avx512_double_compressstore>( >> 234: left_addr, right_addr, k, reg); >> 235: } > > Can be removed. This is needed for AVX512 sort... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417690992 From duke at openjdk.org Wed Dec 6 17:23:03 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 17:23:03 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v9] In-Reply-To: References: Message-ID: > The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. > > For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. > > For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. > > **Note:** This PR also improves the performance of AVX512 sort by upto 35%. > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> > > > > > > > > > Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup > -- | -- | -- | -- | -- > ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 > ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 > ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 > ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 > ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 > ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 > ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 > ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 > ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 > ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 > ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 > ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 > ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 > ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 > ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 > ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 > ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 > ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 > > > > > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/... Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: remove unused avx2 64 bit sort functions; add assertions ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16534/files - new: https://git.openjdk.org/jdk/pull/16534/files/bc590d9f..c143e0b9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=07-08 Stats: 128 lines in 4 files changed: 12 ins; 116 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/16534.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16534/head:pull/16534 PR: https://git.openjdk.org/jdk/pull/16534 From duke at openjdk.org Wed Dec 6 17:23:04 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 17:23:04 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v9] In-Reply-To: <7_T6sM3wjbSzZ0ab9FsptbpPnlQ2J4NNctQNkdbDFdI=.b595a8cc-4b14-44c6-8319-00e68fea21c3@github.com> References: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> <7_T6sM3wjbSzZ0ab9FsptbpPnlQ2J4NNctQNkdbDFdI=.b595a8cc-4b14-44c6-8319-00e68fea21c3@github.com> Message-ID: On Wed, 6 Dec 2023 11:59:19 GMT, Magnus Ihse Bursie wrote: >> Hi Magnus (@magicus), >> >>> Are you saying that when compiling with GCC 6, it will just silently ignore `-std=c++17`? I'd have assumed that it printed a warning or error about an unknown or invalid option, if C++17 is not supported. >> >> The GCC complier for versions 6 (and even 5) silently ignores the flag `-std=c++17`. It does not print any warning or error. I tested it with a toy C++ program and also by building OpenJDK using GCC 6. >> >>> You can't check for if compiler options should be enabled or not inside source code files. >> >> what I meant was, there are #ifdef guards using predefined macros in the C++ source code to check for GCC version and make the simdsort code available for compilation or not based on the GCC version >> >> >> // src/java.base/linux/native/libsimdsort/simdsort-support.hpp >> #if defined(_LP64) && (defined(__GNUC__) && ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 5)))) >> #define __SIMDSORT_SUPPORTED_LINUX >> #endif >> >> >> >> //src/java.base/linux/native/libsimdsort/avx2-linux-qsort.cpp >> #include "simdsort-support.hpp" >> #ifdef __SIMDSORT_SUPPORTED_LINUX >> >> #endif > > Okay, then I guess I am fine with this. Thank you Magnus! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417707661 From duke at openjdk.org Wed Dec 6 17:23:13 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 17:23:13 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v8] In-Reply-To: References: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> Message-ID: On Tue, 5 Dec 2023 19:37:34 GMT, Jatin Bhateja wrote: >> Srinivas Vamsi Parasa has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision: >> >> - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort >> - add GCC version guards >> - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort >> - Remove C++17 from C flags >> - add avoid masked stores operation >> - update the code to check for supported simd sort cpus >> - Disable AVX2 sort for 64-bit types >> - Merge branch 'master' of https://git.openjdk.java.net/jdk into simdsort >> - fix jcheck failures due to windows encoding >> - fix carriage return and change insertion sort thresholds >> - ... and 7 more: https://git.openjdk.org/jdk/compare/d4151e5b...bc590d9f > > src/java.base/linux/native/libsimdsort/avx2-emu-funcs.hpp line 64: > >> 62: } >> 63: return lut; >> 64: }(); > > Lut64 is needed for compress64 emulation, can be removed. Removed in the latest commit... > src/java.base/linux/native/libsimdsort/avx2-emu-funcs.hpp line 234: > >> 232: >> 233: vtype::mask_storeu(leftStore, left, temp); >> 234: } > > Can be removed if not being used. Removed in the latest commit... > src/java.base/linux/native/libsimdsort/avx2-emu-funcs.hpp line 277: > >> 275: >> 276: return _mm_popcnt_u32(shortMask); >> 277: } > > Can be removed if not being used. Removed in the latest commit... > src/java.base/linux/native/libsimdsort/avx2-linux-qsort.cpp line 44: > >> 42: break; >> 43: case JVM_T_FLOAT: >> 44: avx2_fast_sort((float*)array, from_index, to_index, INSERTION_SORT_THRESHOLD_32BIT); > > Assertions for unsupported types. Added in the latest commit... > src/java.base/linux/native/libsimdsort/avx2-linux-qsort.cpp line 56: > >> 54: case JVM_T_FLOAT: >> 55: avx2_fast_partition((float*)array, from_index, to_index, pivot_indices, index_pivot1, index_pivot2); >> 56: break; > > Please add assertion for unsupported types. Added in the latest commit... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417701182 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417702999 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417702251 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417701469 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417701705 From duke at openjdk.org Wed Dec 6 17:23:14 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 17:23:14 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v9] In-Reply-To: References: <7ocsRxaWjoU2vxwPUSE7BrnLSL1bF_7Pp8vReacNJvE=.1c044b21-b27e-4e94-8db0-6ae888a1e8b9@github.com> Message-ID: On Tue, 5 Dec 2023 19:19:23 GMT, Jatin Bhateja wrote: >> Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: >> >> remove unused avx2 64 bit sort functions; add assertions > > src/java.base/linux/native/libsimdsort/avx2-linux-qsort.cpp line 50: > >> 48: case JVM_T_DOUBLE: >> 49: avx2_fast_sort((double*)array, from_index, to_index, INSERTION_SORT_THRESHOLD_64BIT); >> 50: break; > > Please add safe assertions for missing types. This is from an older (but outdated) commit. The assertions have been added in other cases. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417706670 From duke at openjdk.org Wed Dec 6 17:48:04 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 17:48:04 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v10] In-Reply-To: References: Message-ID: > The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. > > For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. > > For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. > > **Note:** This PR also improves the performance of AVX512 sort by upto 35%. > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> > > > > > > > > > Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup > -- | -- | -- | -- | -- > ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 > ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 > ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 > ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 > ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 > ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 > ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 > ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 > ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 > ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 > ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 > ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 > ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 > ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 > ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 > ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 > ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 > ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 > > > > > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/... Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: add missing header files ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16534/files - new: https://git.openjdk.org/jdk/pull/16534/files/c143e0b9..7e124581 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=08-09 Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/16534.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16534/head:pull/16534 PR: https://git.openjdk.org/jdk/pull/16534 From jbhateja at openjdk.org Wed Dec 6 17:48:05 2023 From: jbhateja at openjdk.org (Jatin Bhateja) Date: Wed, 6 Dec 2023 17:48:05 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v10] In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 17:44:25 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: > > add missing header files LGTM, thanks! ------------- Marked as reviewed by jbhateja (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16534#pullrequestreview-1768255412 From duke at openjdk.org Wed Dec 6 17:48:06 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 17:48:06 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v10] In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 17:42:39 GMT, Jatin Bhateja wrote: > LGTM, thanks! Thanks Jatin! ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1843372385 From sviswanathan at openjdk.org Wed Dec 6 18:07:45 2023 From: sviswanathan at openjdk.org (Sandhya Viswanathan) Date: Wed, 6 Dec 2023 18:07:45 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v10] In-Reply-To: References: Message-ID: <1H8N81T-C79IER_JFotgxYegmmZHI8-Efbe0vbmO5oU=.2150bacd-7a5a-4a66-8096-662a35cc893e@github.com> On Wed, 6 Dec 2023 17:48:04 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: > > add missing header files @TobiHartmann @vnkozlov Please advice if we can go head and integrate this PR today before the fork. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1843407940 From kvn at openjdk.org Wed Dec 6 18:29:41 2023 From: kvn at openjdk.org (Vladimir Kozlov) Date: Wed, 6 Dec 2023 18:29:41 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v10] In-Reply-To: <1H8N81T-C79IER_JFotgxYegmmZHI8-Efbe0vbmO5oU=.2150bacd-7a5a-4a66-8096-662a35cc893e@github.com> References: <1H8N81T-C79IER_JFotgxYegmmZHI8-Efbe0vbmO5oU=.2150bacd-7a5a-4a66-8096-662a35cc893e@github.com> Message-ID: On Wed, 6 Dec 2023 18:05:22 GMT, Sandhya Viswanathan wrote: > @TobiHartmann @vnkozlov Please advice if we can go head and integrate this PR today before the fork. Too late. Changes looks fine to me (I am still on fence that we moving to C++ implementation of intrinsics and require latest C++ compiler version). I need to run testing for latest version of changes before approval. Lets not rush. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1843446956 From erikj at openjdk.org Wed Dec 6 18:33:36 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Wed, 6 Dec 2023 18:33:36 GMT Subject: RFR: 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll In-Reply-To: References: Message-ID: On Tue, 5 Dec 2023 11:15:18 GMT, Frederic Thevenet wrote: > When building OpenJDK on the Windows platform, version information are embedded as compiled resources into every native library and executable, which typically contain version numbers, copyright information, product name and vendor name (called "Company name" in this context). > > Currently, the value for "Company name" is always the same as that of "vendor-name" but it It would be really useful to some build scenarios to allow for the "company name" property embedded in the VersionInfo compiled resources to be different from the "vendor name" property that is used within the JVM (e.g. java -version). > > This PR adds a "--with-jdk-rc-company-name" configure option which can be used to set "Company name" to its own value, independently of "'vendor-name", in the same fashion as the existing "--with-jdk-rc-name", used to override the values of "File description" and "Product name". > > If "--with-jdk-rc-company-name" isn't used, then the vendor-name value is used instead, reproducing the same behavior than without this patch. Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/16972#pullrequestreview-1768356733 From sviswanathan at openjdk.org Wed Dec 6 18:33:45 2023 From: sviswanathan at openjdk.org (Sandhya Viswanathan) Date: Wed, 6 Dec 2023 18:33:45 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v10] In-Reply-To: References: <1H8N81T-C79IER_JFotgxYegmmZHI8-Efbe0vbmO5oU=.2150bacd-7a5a-4a66-8096-662a35cc893e@github.com> Message-ID: On Wed, 6 Dec 2023 18:26:34 GMT, Vladimir Kozlov wrote: >> @TobiHartmann @vnkozlov Please advice if we can go head and integrate this PR today before the fork. > >> @TobiHartmann @vnkozlov Please advice if we can go head and integrate this PR today before the fork. > > Too late. Changes looks fine to me (I am still on fence that we moving to C++ implementation of intrinsics and require latest C++ compiler version). I need to run testing for latest version of changes before approval. Lets not rush. Thanks a lot @vnkozlov, we will wait for your approval. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1843454162 From darcy at openjdk.org Wed Dec 6 18:41:57 2023 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 6 Dec 2023 18:41:57 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v6] In-Reply-To: References: Message-ID: > Time to start making preparations for JDK 23. Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: - Regenerate JDK 22 symbol files. - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Add symbol files. - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Update symbol files to JDK 22 b26. - ... and 8 more: https://git.openjdk.org/jdk/compare/db5613af...efe849f6 ------------- Changes: https://git.openjdk.org/jdk/pull/16505/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16505&range=05 Stats: 4866 lines in 98 files changed: 4828 ins; 0 del; 38 mod Patch: https://git.openjdk.org/jdk/pull/16505.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16505/head:pull/16505 PR: https://git.openjdk.org/jdk/pull/16505 From kvn at openjdk.org Wed Dec 6 18:44:47 2023 From: kvn at openjdk.org (Vladimir Kozlov) Date: Wed, 6 Dec 2023 18:44:47 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v10] In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 17:48:04 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: > > add missing header files src/hotspot/share/opto/library_call.cpp line 5393: > 5391: if (!Matcher::supports_simd_sort(bt)) { > 5392: return false; > 5393: } This check should be in `C2Compiler::is_intrinsic_supported()` src/hotspot/share/opto/library_call.cpp line 5450: > 5448: if (!Matcher::supports_simd_sort(bt)) { > 5449: return false; > 5450: } Same. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417831171 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417832246 From duke at openjdk.org Wed Dec 6 20:36:04 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 20:36:04 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v11] In-Reply-To: References: Message-ID: > The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. > > For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. > > For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. > > **Note:** This PR also improves the performance of AVX512 sort by upto 35%. > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> > > > > > > > > > Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup > -- | -- | -- | -- | -- > ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 > ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 > ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 > ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 > ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 > ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 > ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 > ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 > ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 > ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 > ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 > ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 > ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 > ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 > ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 > ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 > ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 > ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 > > > > > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/... Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: Change supported intrinsic check ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16534/files - new: https://git.openjdk.org/jdk/pull/16534/files/7e124581..9621eb04 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=09-10 Stats: 28 lines in 4 files changed: 20 ins; 0 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/16534.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16534/head:pull/16534 PR: https://git.openjdk.org/jdk/pull/16534 From duke at openjdk.org Wed Dec 6 20:36:09 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 20:36:09 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v10] In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 18:41:26 GMT, Vladimir Kozlov wrote: >> Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: >> >> add missing header files > > src/hotspot/share/opto/library_call.cpp line 5393: > >> 5391: if (!Matcher::supports_simd_sort(bt)) { >> 5392: return false; >> 5393: } > > This check should be in `C2Compiler::is_intrinsic_supported()` Hi Vladimir (@vnkozlov), please see the updated changes which use `C2Compiler::is_intrinsic_supported(id, bt)` > src/hotspot/share/opto/library_call.cpp line 5450: > >> 5448: if (!Matcher::supports_simd_sort(bt)) { >> 5449: return false; >> 5450: } > > Same. Please see the updated changes which use C2Compiler::is_intrinsic_supported(id, bt) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417946689 PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1417946968 From kvn at openjdk.org Wed Dec 6 22:59:41 2023 From: kvn at openjdk.org (Vladimir Kozlov) Date: Wed, 6 Dec 2023 22:59:41 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v10] In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 17:44:24 GMT, Srinivas Vamsi Parasa wrote: >> LGTM, thanks! > >> LGTM, thanks! > > Thanks Jatin! @vamsi-parasa, sorry, I was wrong. I missed that you need to check type `bt`. Latest change is more complicated than it was before. Please revert it back (undo last change). I will test previous version 09. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1843822075 From duke at openjdk.org Wed Dec 6 23:12:13 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 23:12:13 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: Message-ID: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> > The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. > > For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. > > For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. > > **Note:** This PR also improves the performance of AVX512 sort by upto 35%. > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> > > > > > > > > > Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup > -- | -- | -- | -- | -- > ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 > ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 > ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 > ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 > ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 > ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 > ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 > ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 > ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 > ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 > ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 > ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 > ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 > ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 > ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 > ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 > ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 > ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 > > > > > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/... Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: Revert "Change supported intrinsic check" This reverts commit 9621eb045c2958582f81ec06b237789a07481ddd. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16534/files - new: https://git.openjdk.org/jdk/pull/16534/files/9621eb04..eadba369 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=11 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16534&range=10-11 Stats: 28 lines in 4 files changed: 0 ins; 20 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/16534.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16534/head:pull/16534 PR: https://git.openjdk.org/jdk/pull/16534 From duke at openjdk.org Wed Dec 6 23:12:14 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Wed, 6 Dec 2023 23:12:14 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 17:44:24 GMT, Srinivas Vamsi Parasa wrote: >> LGTM, thanks! > >> LGTM, thanks! > > Thanks Jatin! > @vamsi-parasa, sorry, I was wrong. I missed that you need to check type `bt`. Latest change is more complicated than it was before. Please revert it back (undo last change). I will test previous version 09. @vnkozlov Vladimir, please see the commit reverted in the updated changes pushed now. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1843834085 From kvn at openjdk.org Wed Dec 6 23:17:42 2023 From: kvn at openjdk.org (Vladimir Kozlov) Date: Wed, 6 Dec 2023 23:17:42 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> References: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> Message-ID: On Wed, 6 Dec 2023 23:12:13 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: > > Revert "Change supported intrinsic check" > > This reverts commit 9621eb045c2958582f81ec06b237789a07481ddd. Good. I submitted testing. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1843839669 From kvn at openjdk.org Thu Dec 7 00:34:48 2023 From: kvn at openjdk.org (Vladimir Kozlov) Date: Thu, 7 Dec 2023 00:34:48 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 23:09:01 GMT, Srinivas Vamsi Parasa wrote: >>> LGTM, thanks! >> >> Thanks Jatin! > >> @vamsi-parasa, sorry, I was wrong. I missed that you need to check type `bt`. Latest change is more complicated than it was before. Please revert it back (undo last change). I will test previous version 09. > @vnkozlov > Vladimir, please see the commit reverted in the updated changes pushed now. @vamsi-parasa, please, remind me which tests check that code in `libsmdsort.so` is used? ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1843938518 From duke at openjdk.org Thu Dec 7 01:03:47 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Thu, 7 Dec 2023 01:03:47 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 23:09:01 GMT, Srinivas Vamsi Parasa wrote: >>> LGTM, thanks! >> >> Thanks Jatin! > >> @vamsi-parasa, sorry, I was wrong. I missed that you need to check type `bt`. Latest change is more complicated than it was before. Please revert it back (undo last change). I will test previous version 09. > @vnkozlov > Vladimir, please see the commit reverted in the updated changes pushed now. > @vamsi-parasa, please, remind me which tests check that code in `libsmdsort.so` is used? @vnkozlov Please see the tests for simd sort code in `test/jdk/java/util/Arrays/Sorting.java` ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1843963054 From darcy at openjdk.org Thu Dec 7 06:33:02 2023 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 7 Dec 2023 06:33:02 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v7] In-Reply-To: References: Message-ID: > Time to start making preparations for JDK 23. Joe Darcy 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 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Regenerate JDK 22 symbol files. - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - Add symbol files. - Merge branch 'master' into JDK-8319413 - Merge branch 'master' into JDK-8319413 - ... and 11 more: https://git.openjdk.org/jdk/compare/632a3c56...4a871372 ------------- Changes: https://git.openjdk.org/jdk/pull/16505/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16505&range=06 Stats: 4866 lines in 98 files changed: 4828 ins; 0 del; 38 mod Patch: https://git.openjdk.org/jdk/pull/16505.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16505/head:pull/16505 PR: https://git.openjdk.org/jdk/pull/16505 From darcy at openjdk.org Thu Dec 7 06:41:09 2023 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 7 Dec 2023 06:41:09 GMT Subject: RFR: JDK-8319413: Start of release updates for JDK 23 [v8] In-Reply-To: References: Message-ID: > Time to start making preparations for JDK 23. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Update copyright year. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16505/files - new: https://git.openjdk.org/jdk/pull/16505/files/4a871372..a1aa187c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16505&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16505&range=06-07 Stats: 6 lines in 6 files changed: 0 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/16505.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16505/head:pull/16505 PR: https://git.openjdk.org/jdk/pull/16505 From xgong at openjdk.org Thu Dec 7 06:41:16 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Thu, 7 Dec 2023 06:41:16 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v8] In-Reply-To: References: Message-ID: <_hHpYHZtmwFRLVj4waIAI1iWq8AINtdwx2Wtp-ZztrM=.c7f07b96-914f-4f67-a2a7-761be6e36e92@github.com> > Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). > > SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. > > To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. > > Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. > > [1] https://github.com/openjdk/jdk/pull/3638 > [2] https://sleef.org/ > [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ > [4] https://packages.debian.org/bookworm/libsleef3 > [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision: - Remove -fvisibility in makefile and add the attribute in source code - Merge branch 'jdk:master' into JDK-8312425 - Add "--with-libsleef-lib" and "--with-libsleef-include" options - Separate neon and sve functions into two source files - Merge branch 'jdk:master' into JDK-8312425 - Rename vmath to sleef in configure - Address review comments in build system - Add a bundled native lib in jdk as a bridge to libsleef - Merge 'jdk:master' into JDK-8312425 - Disable sleef by default - ... and 2 more: https://git.openjdk.org/jdk/compare/6feb6794...c55357b6 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16234/files - new: https://git.openjdk.org/jdk/pull/16234/files/f3ff0672..c55357b6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16234&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16234&range=06-07 Stats: 83778 lines in 1591 files changed: 38309 ins; 39305 del; 6164 mod Patch: https://git.openjdk.org/jdk/pull/16234.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16234/head:pull/16234 PR: https://git.openjdk.org/jdk/pull/16234 From sspitsyn at openjdk.org Thu Dec 7 07:08:47 2023 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Thu, 7 Dec 2023 07:08:47 GMT Subject: RFR: 8311218: fatal error: stuck in JvmtiVTMSTransitionDisabler::VTMS_transition_disable Message-ID: This fix is for JDK 23 but the intention is to back port it to 22 in RDP-1 time frame. It is fixing a deadlock issue between `VirtualThread` class critical sections with the `interruptLock` (in methods: `unpark()`, `interrupt()`, `getAndClearInterrupt()`, `threadState()`, `toString()`), `JvmtiVTMSTransitionDisabler` and JVMTI `Suspend/Resume` mechanisms. The deadlocking scenario is well described by Patricio in a bug report comment. In simple words, a virtual thread should not be suspended during 'interruptLock' critical sections. The fix is to record that a virtual thread is in a critical section (`JavaThread`'s `_in_critical_section` bit) by notifying the VM/JVMTI about begin/end of critical section. This bit is used in `HandshakeState::get_op_for_self()` to filter out any `HandshakeOperation` if a target `JavaThread` is in a critical section. Some of new notifications with `notifyJvmtiSync()` method is on a performance critical path. It is why this method has been intrincified. New test was developed by Patricio: `test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendWithInterruptLock` The test is very nice as it reliably in 100% reproduces the deadlock without the fix. The test is never failing with this fix. Testing: - tested with newly added test: `test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendWithInterruptLock` - tested with mach5 tiers 1-6 ------------- Commit messages: - added @summary to new test SuspendWithInterruptLock.java - add new test SuspendWithInterruptLock.java - 8311218: fatal error: stuck in JvmtiVTMSTransitionDisabler::VTMS_transition_disable Changes: https://git.openjdk.org/jdk/pull/17011/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17011&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8311218 Stats: 183 lines in 15 files changed: 178 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/17011.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17011/head:pull/17011 PR: https://git.openjdk.org/jdk/pull/17011 From xgong at openjdk.org Thu Dec 7 09:30:01 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Thu, 7 Dec 2023 09:30:01 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v9] In-Reply-To: References: Message-ID: > Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). > > SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. > > To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. > > Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. > > [1] https://github.com/openjdk/jdk/pull/3638 > [2] https://sleef.org/ > [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ > [4] https://packages.debian.org/bookworm/libsleef3 > [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: Fix potential attribute issue ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16234/files - new: https://git.openjdk.org/jdk/pull/16234/files/c55357b6..7a4be736 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16234&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16234&range=07-08 Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/16234.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16234/head:pull/16234 PR: https://git.openjdk.org/jdk/pull/16234 From xgong at openjdk.org Thu Dec 7 09:30:05 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Thu, 7 Dec 2023 09:30:05 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v7] In-Reply-To: <0ya82eFBzsE0U96QMoP7OKmd7PAvW7GFXYP_iD_HTqE=.f12ca572-4a4e-4fbd-947b-e11f0aad81a1@github.com> References: <0ya82eFBzsE0U96QMoP7OKmd7PAvW7GFXYP_iD_HTqE=.f12ca572-4a4e-4fbd-947b-e11f0aad81a1@github.com> Message-ID: On Wed, 6 Dec 2023 11:46:03 GMT, Magnus Ihse Bursie wrote: >> Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: >> >> Add "--with-libsleef-lib" and "--with-libsleef-include" options > > make/modules/jdk.incubator.vector/Lib.gmk line 45: > >> 43: $(eval $(call SetupJdkLibrary, BUILD_LIBVMATH, \ >> 44: NAME := vmath, \ >> 45: CFLAGS := $(CFLAGS_JDKLIB) $(LIBSLEEF_CFLAGS) -fvisibility=default, \ > > Why `-fvisibility=default`? (Sorry, only noticed this now) Yeah. Considering all the symbols in this lib are global and need to be exported, I added this flag here instead of the source code. I'v removed this in latest commit, and added the attribute visibility in source code like other jdk code. Please help to review again. Thanks a lot! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16234#discussion_r1418458207 From ihse at openjdk.org Thu Dec 7 09:42:45 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 7 Dec 2023 09:42:45 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v9] In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 09:30:01 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: > > Fix potential attribute issue Build changes finally look good. Great, actually! Thanks for persisting, despite the many rounds of review. You will still need the 2 hotspot reviews for the hotspot part of the patch. ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16234#pullrequestreview-1769660206 From darcy at openjdk.org Thu Dec 7 17:04:41 2023 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 7 Dec 2023 17:04:41 GMT Subject: Integrated: JDK-8319413: Start of release updates for JDK 23 In-Reply-To: References: Message-ID: On Fri, 3 Nov 2023 23:42:03 GMT, Joe Darcy wrote: > Time to start making preparations for JDK 23. This pull request has now been integrated. Changeset: 519ecd35 Author: Joe Darcy Committer: Jesper Wilhelmsson URL: https://git.openjdk.org/jdk/commit/519ecd352a66633589f160db7390647d90e36b99 Stats: 4872 lines in 98 files changed: 4828 ins; 0 del; 44 mod 8319413: Start of release updates for JDK 23 8319414: Add SourceVersion.RELEASE_23 8319416: Add source 23 and target 23 to javac Reviewed-by: iris, erikj, alanb, vromero ------------- PR: https://git.openjdk.org/jdk/pull/16505 From djelinski at openjdk.org Thu Dec 7 19:55:06 2023 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Thu, 7 Dec 2023 19:55:06 GMT Subject: RFR: 8321533: Clang build for Windows Message-ID: I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. In order to use the clang compiler: - install Visual Studio 2022 - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) - configure `--with-toolchain-type=clcl` - compile as usual. Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. ------------- Commit messages: - Rename mscl->clcl - Add MSCL toolchain type Changes: https://git.openjdk.org/jdk/pull/17019/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17019&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8321533 Stats: 109 lines in 9 files changed: 72 ins; 0 del; 37 mod Patch: https://git.openjdk.org/jdk/pull/17019.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17019/head:pull/17019 PR: https://git.openjdk.org/jdk/pull/17019 From erikj at openjdk.org Thu Dec 7 20:56:17 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Thu, 7 Dec 2023 20:56:17 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: <2rHI8VWXECNcwZ1EW6s8RNIGlR7gLR4htZ39B1SmMiY=.e802099a-82dc-4656-ace6-066c497b3bcd@github.com> On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. I only commented on minor style issues. I would like to hear from others what they think about the validity of this approach. Does it work with current devkits, or are they missing something? How is build performance relative to regular `cl`? make/autoconf/spec.gmk.in line 167: > 165: export PATH := @TOOLCHAIN_PATH@:$(PATH) > 166: endif > 167: ifeq (@TOOLCHAIN_TYPE@, clcl) You can combine this with the ifeq above using an ifneq like this: ifneq ($(filter @TOOLCHAIN_TYPE@, microsoft clcl), ) make/common/NativeCompilation.gmk line 450: > 448: $$(call LogInfo, Compiling $$($1_FILENAME) (for $$($$($1_BASE)_BASENAME))) > 449: $$(call MakeDir, $$(@D)) > 450: ifeq ($(findstring $(TOOLCHAIN_TYPE), microsoft clcl), ) I know `findstring` is used frequently for this construct in the makefile, but I prefer `filter` in cases like this as it only matches complete words. ------------- PR Review: https://git.openjdk.org/jdk/pull/17019#pullrequestreview-1771104027 PR Review Comment: https://git.openjdk.org/jdk/pull/17019#discussion_r1419645950 PR Review Comment: https://git.openjdk.org/jdk/pull/17019#discussion_r1419649071 From erikj at openjdk.org Thu Dec 7 23:34:23 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Thu, 7 Dec 2023 23:34:23 GMT Subject: RFR: 8321557: Move SOURCE line verification of OracleJDK out of OpenJDK Message-ID: The main goal of this patch is to remove the OracleJDK specific verification of the SOURCE field in the release file from the OpenJDK test. While at it, I decided to do some cleanup as well to make the code a bit more modern and less unnecessarily verbose. ------------- Commit messages: - Rename method - JDK-8321557 Changes: https://git.openjdk.org/jdk/pull/17027/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17027&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8321557 Stats: 70 lines in 1 file changed: 8 ins; 39 del; 23 mod Patch: https://git.openjdk.org/jdk/pull/17027.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17027/head:pull/17027 PR: https://git.openjdk.org/jdk/pull/17027 From kvn at openjdk.org Fri Dec 8 00:36:21 2023 From: kvn at openjdk.org (Vladimir Kozlov) Date: Fri, 8 Dec 2023 00:36:21 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> References: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> Message-ID: On Wed, 6 Dec 2023 23:12:13 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: > > Revert "Change supported intrinsic check" > > This reverts commit 9621eb045c2958582f81ec06b237789a07481ddd. Testing have only one failure in closed tests and I need to fix it before this can be pushed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1846315767 From duke at openjdk.org Fri Dec 8 00:36:22 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Fri, 8 Dec 2023 00:36:22 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> Message-ID: On Fri, 8 Dec 2023 00:31:26 GMT, Vladimir Kozlov wrote: > Testing have only one failure in closed tests and I need to fix it before this can be pushed. Thanks Vladimir for the update. Is the test failure because of this PR? ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1846317507 From kvn at openjdk.org Fri Dec 8 00:47:23 2023 From: kvn at openjdk.org (Vladimir Kozlov) Date: Fri, 8 Dec 2023 00:47:23 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> Message-ID: On Fri, 8 Dec 2023 00:33:49 GMT, Srinivas Vamsi Parasa wrote: > > Testing have only one failure in closed tests and I need to fix it before this can be pushed. > > Thanks Vladimir for the update. Is the test failure because of this PR? Yes. One of our test, which checks integrity of built JDK, is confused by changes in libsimdsort.so. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1846326542 From xgong at openjdk.org Fri Dec 8 00:53:27 2023 From: xgong at openjdk.org (Xiaohong Gong) Date: Fri, 8 Dec 2023 00:53:27 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v9] In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 09:30:01 GMT, Xiaohong Gong wrote: >> Currently the vector floating-point math APIs like `VectorOperators.SIN/COS/TAN...` are not intrinsified on AArch64 platform, which causes large performance gap on AArch64. Note that those APIs are optimized by C2 compiler on X86 platforms by calling Intel's SVML code [1]. To close the gap, we would like to optimize these APIs for AArch64 by calling a third-party vector library called libsleef [2], which are available in mainstream Linux distros (e.g. [3] [4]). >> >> SLEEF supports multiple accuracies. To match Vector API's requirement and implement the math ops on AArch64, we 1) call 1.0 ULP accuracy with FMA instructions used stubs in libsleef for most of the operations by default, and 2) add the vector calling convention to apply with the runtime calls to stub code in libsleef. Note that for those APIs that libsleef does not support 1.0 ULP, we choose 0.5 ULP instead. >> >> To help loading the expected libsleef library, this patch also adds an experimental JVM option (i.e. `-XX:UseSleefLib`) for AArch64 platforms. People can use it to denote the libsleef path/name explicitly. By default, it points to the system installed library. If the library does not exist or the dynamic loading of it in runtime fails, the math vector ops will fall-back to use the default scalar version without error. But a warning is printed out if people specifies a nonexistent library explicitly. >> >> Note that this is a part of the original proposed patch in panama-dev [5], just with some initial review comments addressed. And now we'd like to get some wider feedbacks from more hotspot experts. >> >> [1] https://github.com/openjdk/jdk/pull/3638 >> [2] https://sleef.org/ >> [3] https://packages.fedoraproject.org/pkgs/sleef/sleef/ >> [4] https://packages.debian.org/bookworm/libsleef3 >> [5] https://mail.openjdk.org/pipermail/panama-dev/2022-December/018172.html > > Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision: > > Fix potential attribute issue > Build changes finally look good. Great, actually! Thanks for persisting, despite the many rounds of review. > > You will still need the 2 hotspot reviews for the hotspot part of the patch. > > /reviewers 3 Thanks for the review and all the comments! ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1846330893 From sspitsyn at openjdk.org Fri Dec 8 01:16:52 2023 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 8 Dec 2023 01:16:52 GMT Subject: RFR: 8311218: fatal error: stuck in JvmtiVTMSTransitionDisabler::VTMS_transition_disable [v2] In-Reply-To: References: Message-ID: > This fix is for JDK 23 but the intention is to back port it to 22 in RDP-1 time frame. > It is fixing a deadlock issue between `VirtualThread` class critical sections with the `interruptLock` (in methods: `unpark()`, `interrupt()`, `getAndClearInterrupt()`, `threadState()`, `toString()`), `JvmtiVTMSTransitionDisabler` and JVMTI `Suspend/Resume` mechanisms. > The deadlocking scenario is well described by Patricio in a bug report comment. > In simple words, a virtual thread should not be suspended during 'interruptLock' critical sections. > > The fix is to record that a virtual thread is in a critical section (`JavaThread`'s `_in_critical_section` bit) by notifying the VM/JVMTI about begin/end of critical section. > This bit is used in `HandshakeState::get_op_for_self()` to filter out any `HandshakeOperation` if a target `JavaThread` is in a critical section. > > Some of new notifications with `notifyJvmtiSync()` method is on a performance critical path. It is why this method has been intrincified. > > New test was developed by Patricio: > `test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendWithInterruptLock` > The test is very nice as it reliably in 100% reproduces the deadlock without the fix. > The test is never failing with this fix. > > Testing: > - tested with newly added test: `test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendWithInterruptLock` > - tested with mach5 tiers 1-6 Serguei Spitsyn has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits: - Resolved merge conflict in VirtualThread.java - added @summary to new test SuspendWithInterruptLock.java - add new test SuspendWithInterruptLock.java - 8311218: fatal error: stuck in JvmtiVTMSTransitionDisabler::VTMS_transition_disable ------------- Changes: https://git.openjdk.org/jdk/pull/17011/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17011&range=01 Stats: 183 lines in 15 files changed: 178 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/17011.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17011/head:pull/17011 PR: https://git.openjdk.org/jdk/pull/17011 From jwaters at openjdk.org Fri Dec 8 08:03:15 2023 From: jwaters at openjdk.org (Julian Waters) Date: Fri, 8 Dec 2023 08:03:15 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. Wow, you're really leaving me in the dust here :P Is it possible to fold clang-cl into the microsoft toolchain instead, and just pass clang-cl as the compiler instead of cl? ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1846726950 From djelinski at openjdk.org Fri Dec 8 09:40:15 2023 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Fri, 8 Dec 2023 09:40:15 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. Thanks for the suggestions, I'll apply them shortly. The current devkits do not contain the required clang frontend (clang-cl.exe, llvm-lib.exe and lld-link.exe). I compared `make hotspot` performance, got the following results: - default toolchain (msvc 19.35): 6 min 35 sec - this PR (clang 15.0.1): 7 min 41 sec - this PR with compiler warnings disabled: 6 min 47 sec so it's going to be slightly slower than MSVC once we have all the warning suppressions in place. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1846860566 From djelinski at openjdk.org Fri Dec 8 09:49:13 2023 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Fri, 8 Dec 2023 09:49:13 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 08:00:45 GMT, Julian Waters wrote: > Is it possible to fold clang-cl into the microsoft toolchain instead, and just pass clang-cl as the compiler instead of cl? I suppose it's possible; clang-cl output is supposed to be compatible with link & lib, and most command line options are similar. The thing is, when it comes to warning control, only W0-W4 are somewhat similar between clang-cl and microsoft; other than that, clang-cl accepts the same options as the regular clang. Folding clang-cl into microsoft would leave us with no way to suppress warnings. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1846872278 From jwaters at openjdk.org Fri Dec 8 10:15:13 2023 From: jwaters at openjdk.org (Julian Waters) Date: Fri, 8 Dec 2023 10:15:13 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 09:46:59 GMT, Daniel Jeli?ski wrote: > > Is it possible to fold clang-cl into the microsoft toolchain instead, and just pass clang-cl as the compiler instead of cl? > > I suppose it's possible; clang-cl output is supposed to be compatible with link & lib, and most command line options are similar. > > The thing is, when it comes to warning control, only W0-W4 are somewhat similar between clang-cl and microsoft; other than that, clang-cl accepts the same options as the regular clang. Folding clang-cl into microsoft would leave us with no way to suppress warnings. My main concern is that this occludes clang proper, if and when that becomes a thing. If so, the clcl options might become a little redundant when compared with the existing clang option. Maybe there can be some specialized code to detect if microsoft is really clang-cl in disguise, or perhaps this could use the clang option that we already have in the build system, and then have --with-toolchain-type=clang mean either clang-cl or clang proper when the platform is Windows ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1846906553 From ihse at openjdk.org Fri Dec 8 10:26:23 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 10:26:23 GMT Subject: RFR: 8316657: Support whitebox testing in microbenchmarks Message-ID: The need to use whitebox-testing (wb.jar) from JMH microbenchmarks has recently arisen. ------------- Commit messages: - 8316657: Support whitebox testing in microbenchmarks Changes: https://git.openjdk.org/jdk/pull/16996/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16996&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8316657 Stats: 61 lines in 4 files changed: 41 ins; 7 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/16996.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16996/head:pull/16996 PR: https://git.openjdk.org/jdk/pull/16996 From ihse at openjdk.org Fri Dec 8 10:51:17 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 10:51:17 GMT Subject: RFR: 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll In-Reply-To: References: Message-ID: On Tue, 5 Dec 2023 11:15:18 GMT, Frederic Thevenet wrote: > When building OpenJDK on the Windows platform, version information are embedded as compiled resources into every native library and executable, which typically contain version numbers, copyright information, product name and vendor name (called "Company name" in this context). > > Currently, the value for "Company name" is always the same as that of "vendor-name" but it It would be really useful to some build scenarios to allow for the "company name" property embedded in the VersionInfo compiled resources to be different from the "vendor name" property that is used within the JVM (e.g. java -version). > > This PR adds a "--with-jdk-rc-company-name" configure option which can be used to set "Company name" to its own value, independently of "'vendor-name", in the same fashion as the existing "--with-jdk-rc-name", used to override the values of "File description" and "Product name". > > If "--with-jdk-rc-company-name" isn't used, then the vendor-name value is used instead, reproducing the same behavior than without this patch. Marked as reviewed by ihse (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/16972#pullrequestreview-1772102544 From sspitsyn at openjdk.org Fri Dec 8 11:54:40 2023 From: sspitsyn at openjdk.org (Serguei Spitsyn) Date: Fri, 8 Dec 2023 11:54:40 GMT Subject: RFR: 8311218: fatal error: stuck in JvmtiVTMSTransitionDisabler::VTMS_transition_disable [v3] In-Reply-To: References: Message-ID: <-3HkgdDQk9480AnHQeIxaNsqK0nVzjaf6UZJ5E9LGHo=.bdff2ed6-db98-4a77-832f-6accad54245f@github.com> > This fix is for JDK 23 but the intention is to back port it to 22 in RDP-1 time frame. > It is fixing a deadlock issue between `VirtualThread` class critical sections with the `interruptLock` (in methods: `unpark()`, `interrupt()`, `getAndClearInterrupt()`, `threadState()`, `toString()`), `JvmtiVTMSTransitionDisabler` and JVMTI `Suspend/Resume` mechanisms. > The deadlocking scenario is well described by Patricio in a bug report comment. > In simple words, a virtual thread should not be suspended during 'interruptLock' critical sections. > > The fix is to record that a virtual thread is in a critical section (`JavaThread`'s `_in_critical_section` bit) by notifying the VM/JVMTI about begin/end of critical section. > This bit is used in `HandshakeState::get_op_for_self()` to filter out any `HandshakeOperation` if a target `JavaThread` is in a critical section. > > Some of new notifications with `notifyJvmtiSync()` method is on a performance critical path. It is why this method has been intrincified. > > New test was developed by Patricio: > `test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendWithInterruptLock` > The test is very nice as it reliably in 100% reproduces the deadlock without the fix. > The test is never failing with this fix. > > Testing: > - tested with newly added test: `test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendWithInterruptLock` > - tested with mach5 tiers 1-6 Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: review: (1) rename notifyJvmti method; (2) add try-final statements to VirtualThread methods ------------- Changes: - all: https://git.openjdk.org/jdk/pull/17011/files - new: https://git.openjdk.org/jdk/pull/17011/files/ccba940d..18f1752e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17011&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17011&range=01-02 Stats: 80 lines in 9 files changed: 25 ins; 7 del; 48 mod Patch: https://git.openjdk.org/jdk/pull/17011.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17011/head:pull/17011 PR: https://git.openjdk.org/jdk/pull/17011 From djelinski at openjdk.org Fri Dec 8 11:59:16 2023 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Fri, 8 Dec 2023 11:59:16 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. Well I can't tell the future, but at this point in time, implementing support for clang-cl requires much less effort than implementing support for the gcc clang frontend. The end result is equivalent - in both cases we use the same compiler. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1847052032 From alanb at openjdk.org Fri Dec 8 12:09:15 2023 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 8 Dec 2023 12:09:15 GMT Subject: RFR: 8311218: fatal error: stuck in JvmtiVTMSTransitionDisabler::VTMS_transition_disable [v3] In-Reply-To: <-3HkgdDQk9480AnHQeIxaNsqK0nVzjaf6UZJ5E9LGHo=.bdff2ed6-db98-4a77-832f-6accad54245f@github.com> References: <-3HkgdDQk9480AnHQeIxaNsqK0nVzjaf6UZJ5E9LGHo=.bdff2ed6-db98-4a77-832f-6accad54245f@github.com> Message-ID: On Fri, 8 Dec 2023 11:54:40 GMT, Serguei Spitsyn wrote: >> This fix is for JDK 23 but the intention is to back port it to 22 in RDP-1 time frame. >> It is fixing a deadlock issue between `VirtualThread` class critical sections with the `interruptLock` (in methods: `unpark()`, `interrupt()`, `getAndClearInterrupt()`, `threadState()`, `toString()`), `JvmtiVTMSTransitionDisabler` and JVMTI `Suspend/Resume` mechanisms. >> The deadlocking scenario is well described by Patricio in a bug report comment. >> In simple words, a virtual thread should not be suspended during 'interruptLock' critical sections. >> >> The fix is to record that a virtual thread is in a critical section (`JavaThread`'s `_in_critical_section` bit) by notifying the VM/JVMTI about begin/end of critical section. >> This bit is used in `HandshakeState::get_op_for_self()` to filter out any `HandshakeOperation` if a target `JavaThread` is in a critical section. >> >> Some of new notifications with `notifyJvmtiSync()` method is on a performance critical path. It is why this method has been intrincified. >> >> New test was developed by Patricio: >> `test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendWithInterruptLock` >> The test is very nice as it reliably in 100% reproduces the deadlock without the fix. >> The test is never failing with this fix. >> >> Testing: >> - tested with newly added test: `test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendWithInterruptLock` >> - tested with mach5 tiers 1-6 > > Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision: > > review: (1) rename notifyJvmti method; (2) add try-final statements to VirtualThread methods I chatted briefly with @sspitsyn about this. A couple of points: - It shouldn't be necessary to touch mount/unmount as the thread identity is the carrier, not the virtual thread, when executing the "critical code". - toggle_is_in_critical_section needs to detect reentrancy, it is otherwise too early to refactor the Java code, e.g. call threadState while holding the interrupt lock. - All the use-sides will need to use try-finally to more reliably revert the critical section flag when rewinding. - The naming is very problematic, we'll need to replace with methods that are clearly named enter and exit critical section. Ongoing work in this area to support monitors has to introduce some temporary pinning so there will be enter/exitCriticalSection methods, that's a better place for the JVMTI hooks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17011#issuecomment-1847063362 From fthevenet at openjdk.org Fri Dec 8 13:48:15 2023 From: fthevenet at openjdk.org (Frederic Thevenet) Date: Fri, 8 Dec 2023 13:48:15 GMT Subject: RFR: 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 18:30:58 GMT, Erik Joelsson wrote: >> When building OpenJDK on the Windows platform, version information are embedded as compiled resources into every native library and executable, which typically contain version numbers, copyright information, product name and vendor name (called "Company name" in this context). >> >> Currently, the value for "Company name" is always the same as that of "vendor-name" but it It would be really useful to some build scenarios to allow for the "company name" property embedded in the VersionInfo compiled resources to be different from the "vendor name" property that is used within the JVM (e.g. java -version). >> >> This PR adds a "--with-jdk-rc-company-name" configure option which can be used to set "Company name" to its own value, independently of "'vendor-name", in the same fashion as the existing "--with-jdk-rc-name", used to override the values of "File description" and "Product name". >> >> If "--with-jdk-rc-company-name" isn't used, then the vendor-name value is used instead, reproducing the same behavior than without this patch. > > Marked as reviewed by erikj (Reviewer). Thanks for the reviews @erikj79 and @magicus. Could one of you please sponsor this? Cheers! ------------- PR Comment: https://git.openjdk.org/jdk/pull/16972#issuecomment-1847188041 From fthevenet at openjdk.org Fri Dec 8 14:13:21 2023 From: fthevenet at openjdk.org (Frederic Thevenet) Date: Fri, 8 Dec 2023 14:13:21 GMT Subject: RFR: 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 10:48:51 GMT, Magnus Ihse Bursie wrote: >> When building OpenJDK on the Windows platform, version information are embedded as compiled resources into every native library and executable, which typically contain version numbers, copyright information, product name and vendor name (called "Company name" in this context). >> >> Currently, the value for "Company name" is always the same as that of "vendor-name" but it It would be really useful to some build scenarios to allow for the "company name" property embedded in the VersionInfo compiled resources to be different from the "vendor name" property that is used within the JVM (e.g. java -version). >> >> This PR adds a "--with-jdk-rc-company-name" configure option which can be used to set "Company name" to its own value, independently of "'vendor-name", in the same fashion as the existing "--with-jdk-rc-name", used to override the values of "File description" and "Product name". >> >> If "--with-jdk-rc-company-name" isn't used, then the vendor-name value is used instead, reproducing the same behavior than without this patch. > > Marked as reviewed by ihse (Reviewer). Thanks @magicus ------------- PR Comment: https://git.openjdk.org/jdk/pull/16972#issuecomment-1847228469 From fthevenet at openjdk.org Fri Dec 8 14:13:23 2023 From: fthevenet at openjdk.org (Frederic Thevenet) Date: Fri, 8 Dec 2023 14:13:23 GMT Subject: Integrated: 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll In-Reply-To: References: Message-ID: On Tue, 5 Dec 2023 11:15:18 GMT, Frederic Thevenet wrote: > When building OpenJDK on the Windows platform, version information are embedded as compiled resources into every native library and executable, which typically contain version numbers, copyright information, product name and vendor name (called "Company name" in this context). > > Currently, the value for "Company name" is always the same as that of "vendor-name" but it It would be really useful to some build scenarios to allow for the "company name" property embedded in the VersionInfo compiled resources to be different from the "vendor name" property that is used within the JVM (e.g. java -version). > > This PR adds a "--with-jdk-rc-company-name" configure option which can be used to set "Company name" to its own value, independently of "'vendor-name", in the same fashion as the existing "--with-jdk-rc-name", used to override the values of "File description" and "Product name". > > If "--with-jdk-rc-company-name" isn't used, then the vendor-name value is used instead, reproducing the same behavior than without this patch. This pull request has now been integrated. Changeset: 05f95093 Author: Frederic Thevenet Committer: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/05f950934ee720c82e9b62dd8d31e13bab7775da Stats: 11 lines in 3 files changed: 10 ins; 0 del; 1 mod 8321374: Add a configure option to explicitly set CompanyName property in VersionInfo resource for Windows exe/dll Reviewed-by: erikj, ihse ------------- PR: https://git.openjdk.org/jdk/pull/16972 From erikj at openjdk.org Fri Dec 8 14:20:14 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 8 Dec 2023 14:20:14 GMT Subject: RFR: 8316657: Support whitebox testing in microbenchmarks In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 15:32:14 GMT, Magnus Ihse Bursie wrote: > The need to use whitebox-testing (wb.jar) from JMH microbenchmarks has recently arisen. Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/16996#pullrequestreview-1772448490 From redestad at openjdk.org Fri Dec 8 14:49:15 2023 From: redestad at openjdk.org (Claes Redestad) Date: Fri, 8 Dec 2023 14:49:15 GMT Subject: RFR: 8316657: Support whitebox testing in microbenchmarks In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 15:32:14 GMT, Magnus Ihse Bursie wrote: > The need to use whitebox-testing (wb.jar) from JMH microbenchmarks has recently arisen. Adding wb.jar to the test image is great. Maybe that could be done separately? I think we need a different solution here that does not pollute the bootclasspath for all microbenchmarks with wb.jar. Ideally `make test TEST=micro:foo` should be strictly an alias for `$JDK/bin/java -jar test/micro/benchmarks.jar foo` (none of our scripts and lab setups use the `make` support to run microbenchmarks but rather download the test image and run the jar directly); this PR steps away from that ideal. Something self-contained where the wb.jar is appended explicitly to forked runs by those tests that explicitly need it would be strongly preferred. Perhaps we can do so in a robust fashion with annotations alone since the wb.jar should be relative to the benchmarks.jar, perhaps through the JMH java API. ------------- PR Comment: https://git.openjdk.org/jdk/pull/16996#issuecomment-1847306934 From ihse at openjdk.org Fri Dec 8 14:51:33 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 14:51:33 GMT Subject: RFR: 8321597: Use .template consistently for files treated as templates by the build Message-ID: Some files are used as "templates" in the build, that is, they are almost, but not fully, in the intended state. Instead, they have some pattern markers that need to be replaced with actual content as part of the build. As a convention, most such files are named as `.template`, e.g. `VersionProps.java.template`, to indicate that this is almost, but not fully, a Java file. A few files were created before this convention was fully embraced. These should be renamed to match the pattern. ------------- Commit messages: - Merge branch 'master' into template-rename - 8321597: Use .template consistently for files treated as templates by the build Changes: https://git.openjdk.org/jdk/pull/17033/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17033&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8321597 Stats: 11 lines in 16 files changed: 0 ins; 0 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/17033.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17033/head:pull/17033 PR: https://git.openjdk.org/jdk/pull/17033 From erikj at openjdk.org Fri Dec 8 15:18:13 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 8 Dec 2023 15:18:13 GMT Subject: RFR: 8321597: Use .template consistently for files treated as templates by the build In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 14:43:29 GMT, Magnus Ihse Bursie wrote: > Some files are used as "templates" in the build, that is, they are almost, but not fully, in the intended state. Instead, they have some pattern markers that need to be replaced with actual content as part of the build. > > As a convention, most such files are named as `.template`, e.g. `VersionProps.java.template`, to indicate that this is almost, but not fully, a Java file. > > A few files were created before this convention was fully embraced. These should be renamed to match the pattern. Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17033#pullrequestreview-1772602285 From eastigeevich at openjdk.org Fri Dec 8 15:19:44 2023 From: eastigeevich at openjdk.org (Evgeny Astigeevich) Date: Fri, 8 Dec 2023 15:19:44 GMT Subject: RFR: 8268276: Base64 Decoding optimization for x86 using AVX-512 [v8] In-Reply-To: References: Message-ID: On Thu, 24 Jun 2021 17:02:03 GMT, Scott Gibbons wrote: >> Add the Base64 Decode intrinsic for x86 to utilize AVX-512 for acceleration. Also allows for performance improvement for non-AVX-512 enabled platforms. Due to the nature of MIME-encoded inputs, modify the intrinsic signature to accept an additional parameter (isMIME) for fast-path MIME decoding. >> >> A change was made to the signature of DecodeBlock in Base64.java to provide the intrinsic information as to whether MIME decoding was being done. This allows for the intrinsic to bypass the expensive setup of zmm registers from AVX tables, knowing there may be invalid Base64 characters every 76 characters or so. A change was also made here removing the restriction that the intrinsic must return an even multiple of 3 bytes decoded. This implementation handles the pad characters at the end of the string and will return the actual number of characters decoded. >> >> The AVX portion of this code will decode in blocks of 256 bytes per loop iteration, then in chunks of 64 bytes, followed by end fixup decoding. The non-AVX code is an assembly-optimized version of the java DecodeBlock and behaves identically. >> >> Running the Base64Decode benchmark, this change increases decode performance by an average of 2.6x with a maximum 19.7x for buffers > ~20k. The numbers are given in the table below. >> >> **Base Score** is without intrinsic support, **Optimized Score** is using this intrinsic, and **Gain** is **Base** / **Optimized**. >> >> >> Benchmark Name | Base Score | Optimized Score | Gain >> -- | -- | -- | -- >> testBase64Decode size 1 | 15.36 | 15.32 | 1.00 >> testBase64Decode size 3 | 17.00 | 16.72 | 1.02 >> testBase64Decode size 7 | 20.60 | 18.82 | 1.09 >> testBase64Decode size 32 | 34.21 | 26.77 | 1.28 >> testBase64Decode size 64 | 54.43 | 38.35 | 1.42 >> testBase64Decode size 80 | 66.40 | 48.34 | 1.37 >> testBase64Decode size 96 | 73.16 | 52.90 | 1.38 >> testBase64Decode size 112 | 84.93 | 51.82 | 1.64 >> testBase64Decode size 512 | 288.81 | 32.04 | 9.01 >> testBase64Decode size 1000 | 560.48 | 40.79 | 13.74 >> testBase64Decode size 20000 | 9530.28 | 483.37 | 19.72 >> testBase64Decode size 50000 | 24552.24 | 1735.07 | 14.15 >> testBase64MIMEDecode size 1 | 22.87 | 21.36 | 1.07 >> testBase64MIMEDecode size 3 | 27.79 | 25.32 | 1.10 >> testBase64MIMEDecode size 7 | 44.74 | 43.81 | 1.02 >> testBase64MIMEDecode size 32 | 142.69 | 129.56 | 1.10 >> testBase64MIMEDecode size 64 | 256.90 | 243.80 | 1.05 >> testBase64MIMEDecode size 80 | 311.60 | 310.80 | 1.00 >> testBase64MIMEDecode size... > > Scott Gibbons has updated the pull request incrementally with one additional commit since the last revision: > > Fixed Windows register stomping. We found this optimization causes https://bugs.openjdk.org/browse/JDK-8321599 ------------- PR Comment: https://git.openjdk.org/jdk/pull/4368#issuecomment-1847357495 From ihse at openjdk.org Fri Dec 8 15:49:27 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 15:49:27 GMT Subject: Integrated: 8321597: Use .template consistently for files treated as templates by the build In-Reply-To: References: Message-ID: <6U2t-AXMe6vvv60sQPRmDvKVQFlExldQFAXG2P7B7kg=.83f1669b-c09c-4b50-8720-94b26ff0e4d8@github.com> On Fri, 8 Dec 2023 14:43:29 GMT, Magnus Ihse Bursie wrote: > Some files are used as "templates" in the build, that is, they are almost, but not fully, in the intended state. Instead, they have some pattern markers that need to be replaced with actual content as part of the build. > > As a convention, most such files are named as `.template`, e.g. `VersionProps.java.template`, to indicate that this is almost, but not fully, a Java file. > > A few files were created before this convention was fully embraced. These should be renamed to match the pattern. This pull request has now been integrated. Changeset: b893a2b2 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/b893a2b2f70346f9d204d1050a0ad32fd98fdd56 Stats: 11 lines in 16 files changed: 0 ins; 0 del; 11 mod 8321597: Use .template consistently for files treated as templates by the build Reviewed-by: erikj ------------- PR: https://git.openjdk.org/jdk/pull/17033 From ihse at openjdk.org Fri Dec 8 15:59:13 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 15:59:13 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. This is interesting, but we must be careful to not rush things here. We're basically creating a chimera, mixing assumptions about "windows", "microsoft toolchain" and "clang". Do I understand you correctly that clang-cl uses "mostly" the same arguments as cl, but uses the clang warnings system, e.g. -Wno-foo-loops instead of C1234? That means we need to separate the warning option handling from all the other options. You say something about not disabling warnings adds a minute to the build time. I assume that means that even with your linked patches, the build will spew out warnings. This is not something we can fix "afterwards"; we need to design the integration of clang-cl in a way that we can (hopefully) reuse existing clang warning disables. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1847437678 From ihse at openjdk.org Fri Dec 8 16:03:14 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 16:03:14 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: <3zwUsPqCReEB0tNH28tFxGBbCiG1pbgyuizAV6mj8FA=.83cc850d-7d6d-4077-9e2d-f2d8db330b1b@github.com> On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. And, oh, I must say that I think "clcl" as name for the toolchain is really bad. :-( I think `microsoft-clang` would be the best and clearest name. Possibly, we should rename `microsoft` to `microsoft-cl`, and use `microsoft` as an user-facing alias. At least if the rest of the toolchain is 100% the same as in the current `microsoft` toolchain. Doing that will present both a risk and an opportunity: if we are checking the toolchain using "findstring" for "microsoft", but we really only want to match `microsoft-cl`, then it will break, so any such instances must be discovered and checked. On the other hand, if we do want to treat `microsoft-cl` and `microsoft-clang` the same, then a "findstring" instead of a "filter" will actually do the trick. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1847444124 From ihse at openjdk.org Fri Dec 8 16:08:13 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 16:08:13 GMT Subject: RFR: 8321557: Move SOURCE line verification for OracleJDK out of OpenJDK In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 23:29:48 GMT, Erik Joelsson wrote: > The main goal of this patch is to remove the OracleJDK specific verification of the SOURCE field in the release file from the OpenJDK test. While at it, I decided to do some cleanup as well to make the code a bit more modern and less unnecessarily verbose. Marked as reviewed by ihse (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17027#pullrequestreview-1772729313 From ihse at openjdk.org Fri Dec 8 16:15:15 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 16:15:15 GMT Subject: RFR: 8316657: Support whitebox testing in microbenchmarks In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 15:32:14 GMT, Magnus Ihse Bursie wrote: > The need to use whitebox-testing (wb.jar) from JMH microbenchmarks has recently arisen. make/RunTests.gmk line 598: > 596: endif > 597: > 598: # Set paths for dependencies @cl4es So basically this is the line you're objecting to? I can remove the change in RunTests.gmk for this patch. That way the wb.jar will be available, but additional work is needed for the micros to access it. But that might, as you say, perhaps be solved within the micros themselves, by annotations or whatever. Does that sound reasonable? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16996#discussion_r1420726640 From ihse at openjdk.org Fri Dec 8 16:19:15 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 16:19:15 GMT Subject: RFR: 8316657: Support whitebox testing in microbenchmarks In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 15:32:14 GMT, Magnus Ihse Bursie wrote: > The need to use whitebox-testing (wb.jar) from JMH microbenchmarks has recently arisen. Alternatively, I could also unpack wb.jar alongside `$(JMH_CORE_JAR) $(JMH_COMMONS_MATH_JAR) $(JMH_JOPT_SIMPLE_JAR)`, and re-pack it into `benchmarks.jar`. My gut feeling was that it "polluted" benchmarks.jar unnecessarily, but then again it also creates an additional jar dependency. If the "I just want a single jar with everything" is an important driver here, then that is perhaps the way to go? ------------- PR Comment: https://git.openjdk.org/jdk/pull/16996#issuecomment-1847467298 From magnus.ihse.bursie at oracle.com Fri Dec 8 16:29:21 2023 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 17:29:21 +0100 Subject: Cross compilation discussion In-Reply-To: <789dcb6f-e326-4be6-ba49-0e50e9251e98@littlepinkcloud.com> References: <789dcb6f-e326-4be6-ba49-0e50e9251e98@littlepinkcloud.com> Message-ID: <5daf61ab-13c4-4c6c-9e03-ddef27c744de@oracle.com> > OK. So you are doing what I'd usually call cross compiling, sort of, but > you don't want to treat it as a cross-compiled build. It's an unusual > case, in that it is cross compiled, but it is also expected to be able to > run on the build system. The main reason for the build to know if we're doing a cross-compilation or not has been if we need a special compiler to create build tools. For me, that is in essence what the cross-compilation flag is saying. Separately, we have the concept of sysroot, but I agree that setting the sysroot is essentially a form of cross-compilation. The question is: do the build system need to know about this, any more than just make sure we pass along the sysroot properly? Maybe this is just a question on how to present the needs of the build system to the user, where "cross-compilation" might have different connotations than are used inside the build system. So maybe we should have like "cross-compiling-need-build-compiler" and "cross-complining-can-use-target-compiler"? /Magnus From djelinski at openjdk.org Fri Dec 8 17:11:18 2023 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Fri, 8 Dec 2023 17:11:18 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 15:56:40 GMT, Magnus Ihse Bursie wrote: > Do I understand you correctly that clang-cl uses "mostly" the same arguments as cl, but uses the clang warnings system, e.g. -Wno-foo-loops instead of C1234? That's correct. Clang-cl only supports the following cl warning parameters: /W0 Disable all warnings /W1 Enable -Wall /W2 Enable -Wall /W3 Enable -Wall /W4 Enable -Wall and -Wextra /Wall Enable -Weverything note how `Wall` differs in meaning between clang and clang-cl. [Source](https://clang.llvm.org/docs/UsersManual.html#id10) > I assume that means that even with your linked patches, the build will spew out warnings. Right, with this patch the build produces warnings. No per-file or per-module suppressions are applied. > we need to design the integration of clang-cl in a way that we can (hopefully) reuse existing clang warning disables. I'd love that. Got any preferences on how that should be handled? > And, oh, I must say that I think "clcl" as name for the toolchain is really bad. :-( It was not my first choice. I tried `clang-cl` first; the scripts didn't like the dash. Then I tried `clangcl`, and some of the changes found their way into the MacOS build. `findstring` is tricky to get right. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1847539074 From erik.joelsson at oracle.com Fri Dec 8 20:36:21 2023 From: erik.joelsson at oracle.com (erik.joelsson at oracle.com) Date: Fri, 8 Dec 2023 12:36:21 -0800 Subject: Cross compilation discussion In-Reply-To: <5daf61ab-13c4-4c6c-9e03-ddef27c744de@oracle.com> References: <789dcb6f-e326-4be6-ba49-0e50e9251e98@littlepinkcloud.com> <5daf61ab-13c4-4c6c-9e03-ddef27c744de@oracle.com> Message-ID: <6f40d377-1f06-42ce-a417-27c99bdbf76c@oracle.com> On 12/8/23 08:29, Magnus Ihse Bursie wrote: > >> OK. So you are doing what I'd usually call cross compiling, sort of, but >> you don't want to treat it as a cross-compiled build. It's an unusual >> case, in that it is cross compiled, but it is also expected to be >> able to >> run on the build system. > > The main reason for the build to know if we're doing a > cross-compilation or not has been if we need a special compiler to > create build tools. For me, that is in essence what the > cross-compilation flag is saying. I think the issue now is that automatically figuring out if a separate compiler is needed or not can be hard. We do it in some cases, but not in others, and sometimes we get it wrong (as in the linux-aarch64 issue Mikael recently fixed, where the given tuple didn't exactly match what config.guess found on the build machine). I think it would be reasonable to have a configure parameter to control this explicitly. > > Separately, we have the concept of sysroot, but I agree that setting > the sysroot is essentially a form of cross-compilation. The question > is: do the build system need to know about this, any more than just > make sure we pass along the sysroot properly? > I agree that the purpose of the sysroot is to help configure find headers and libraries, and setup correct flags for compiler and linker tools. > Maybe this is just a question on how to present the needs of the build > system to the user, where "cross-compilation" might have different > connotations than are used inside the build system. > > So maybe we should have like "cross-compiling-need-build-compiler" and > "cross-complining-can-use-target-compiler"? > Not sure of the naming here, but in essence, that's where we are making implicit assumptions today that are hard to control. If you specify --with-openjdk-target and the tuple is different than the build tuple, then we can assume the default is to need a build compiler, but there are cases where that is still not strictly needed. If --with-build-devkit is supplied, then that is also a good indication as we are given an explicit build compiler. Just supplying a sysroot/devkit should probably not be assumed as needing a build compiler, but paired with a suitable option, this could support the cross compile to EL8 from EL7. I could for instance imagine setting --with-build-sysroot=/ to help nudge configure into defining a separate build compiler, but maybe that's too clunky? /Erik From kvn at openjdk.org Fri Dec 8 22:40:21 2023 From: kvn at openjdk.org (Vladimir Kozlov) Date: Fri, 8 Dec 2023 22:40:21 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> References: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> Message-ID: On Wed, 6 Dec 2023 23:12:13 GMT, Srinivas Vamsi Parasa wrote: >> The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. >> >> For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. >> >> For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. >> >> **Note:** This PR also improves the performance of AVX512 sort by upto 35%. >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> >> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> >> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> >> >> >> >> >> >> >> >> >> Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup >> -- | -- | -- | -- | -- >> ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 >> ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 >> ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 >> ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 >> ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 >> ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 >> ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 >> ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 >> ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 >> ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 >> ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 >> ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 >> ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 >> ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 >> ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 >> ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 >> ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 >> ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 >> >> >> >> >> >> > xmlns:o="urn:schemas-microsoft-com:office:office" >> xmlns:x="urn:schemas-microsoft-com:office:excel" >> xmlns="http://www.w3.org/TR/REC-html40"> >> >> >> >> > Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision: > > Revert "Change supported intrinsic check" > > This reverts commit 9621eb045c2958582f81ec06b237789a07481ddd. I pushed closed changes. ------------- Marked as reviewed by kvn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16534#pullrequestreview-1773255608 From shurailine at openjdk.org Fri Dec 8 22:48:25 2023 From: shurailine at openjdk.org (Alexandre Iline) Date: Fri, 8 Dec 2023 22:48:25 GMT Subject: RFR: JDK-8321621: Update JCov version to 3.0.16 Message-ID: JCov support for byte code version 67. ------------- Commit messages: - JDK-8321621: Update JCov version to 3.0.16 Changes: https://git.openjdk.org/jdk/pull/17041/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17041&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8321621 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/17041.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17041/head:pull/17041 PR: https://git.openjdk.org/jdk/pull/17041 From duke at openjdk.org Fri Dec 8 22:51:21 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Fri, 8 Dec 2023 22:51:21 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: <_L--_bl81TgfP1_0bLld6-xzcNqsopfL3HX3bmlbqgE=.923709b1-2e65-4659-a9cd-db4a6ac375c0@github.com> Message-ID: On Fri, 8 Dec 2023 22:37:26 GMT, Vladimir Kozlov wrote: > I pushed closed changes. Thanks Vladimir! ------------- PR Comment: https://git.openjdk.org/jdk/pull/16534#issuecomment-1847939767 From erikj at openjdk.org Fri Dec 8 22:52:18 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 8 Dec 2023 22:52:18 GMT Subject: RFR: JDK-8321621: Update JCov version to 3.0.16 In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 22:42:42 GMT, Alexandre Iline wrote: > JCov support for byte code version 67. Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17041#pullrequestreview-1773267176 From duke at openjdk.org Fri Dec 8 22:55:37 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Fri, 8 Dec 2023 22:55:37 GMT Subject: Integrated: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) In-Reply-To: References: Message-ID: On Tue, 7 Nov 2023 00:12:41 GMT, Srinivas Vamsi Parasa wrote: > The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX2 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. > > For serial sort on random data, this PR shows upto ~7.5x improvement for 32-bit datatypes (int, float) on Intel TigerLake machine as shown in the performance data below. > > For parallel sort on random data, this PR shows upto ~3.4x for 32-bit datatypes (int, float) as shown below. > > **Note:** This PR also improves the performance of AVX512 sort by upto 35%. > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip.htm"> > href="file:///C:/Users/sparasa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml"> > > > > > > > > > Benchmark (Serial Sort) | Size | Baseline (us/op) | AVX2 (us/op) | Speedup > -- | -- | -- | -- | -- > ArraysSort.intSort | 10 | 0.034 | 0.029 | 1.2 > ArraysSort.intSort | 25 | 0.088 | 0.044 | 2.0 > ArraysSort.intSort | 50 | 0.239 | 0.159 | 1.5 > ArraysSort.intSort | 75 | 0.417 | 0.27 | 1.5 > ArraysSort.intSort | 100 | 0.572 | 0.265 | 2.2 > ArraysSort.intSort | 1000 | 10.098 | 4.282 | 2.4 > ArraysSort.intSort | 10000 | 330.065 | 43.383 | 7.6 > ArraysSort.intSort | 100000 | 4099.527 | 778.943 | 5.3 > ArraysSort.intSort | 1000000 | 49150.16 | 9634.335 | 5.1 > ArraysSort.floatSort | 10 | 0.045 | 0.043 | 1.0 > ArraysSort.floatSort | 25 | 0.105 | 0.073 | 1.4 > ArraysSort.floatSort | 50 | 0.278 | 0.216 | 1.3 > ArraysSort.floatSort | 75 | 0.476 | 0.241 | 2.0 > ArraysSort.floatSort | 100 | 0.583 | 0.313 | 1.9 > ArraysSort.floatSort | 1000 | 10.182 | 4.329 | 2.4 > ArraysSort.floatSort | 10000 | 323.136 | 57.175 | 5.7 > ArraysSort.floatSort | 100000 | 4299.519 | 862.63 | 5.0 > ArraysSort.floatSort | 1000000 | 50889.4 | 10972.19 | 4.6 > > > > > > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns="http://www.w3.org/TR/REC-html40"> > > > > > > href="file:///C:/Users/... This pull request has now been integrated. Changeset: ce108446 Author: vamsi-parasa Committer: Sandhya Viswanathan URL: https://git.openjdk.org/jdk/commit/ce108446ca1fe604ecc24bbefb0bf1c6318271c7 Stats: 4026 lines in 24 files changed: 2311 ins; 1560 del; 155 mod 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) Reviewed-by: sviswanathan, ihse, jbhateja, kvn ------------- PR: https://git.openjdk.org/jdk/pull/16534 From ihse at openjdk.org Fri Dec 8 23:20:12 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 8 Dec 2023 23:20:12 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 17:08:33 GMT, Daniel Jeli?ski wrote: > > And, oh, I must say that I think "clcl" as name for the toolchain is really bad. :-( > > It was not my first choice. I tried clang-cl first; the scripts didn't like the dash. Then I tried clangcl, and some of the changes found their way into the MacOS build. findstring is tricky to get right. Then we need to fix those places. As Erik has commented, `findstring` is usually the wrong function to use when what you really mean is `filter`. > > we need to design the integration of clang-cl in a way that we can (hopefully) reuse existing clang warning disables. > > I'd love that. Got any preferences on how that should be handled? Not straight out of my hat, no. I wonder what would happen as a first step if we started looking at the DISABLE_WARNINGS_clang fields, by just using a hack. I'm guessing this will take some experimenting. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1847960400 PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1847962061 From alanb at openjdk.org Sat Dec 9 08:04:12 2023 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 9 Dec 2023 08:04:12 GMT Subject: RFR: JDK-8321621: Update JCov version to 3.0.16 In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 22:42:42 GMT, Alexandre Iline wrote: > JCov support for byte code version 67. Happy to see this being changed soon after the fork. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/17041#pullrequestreview-1773616082 From gli at openjdk.org Mon Dec 11 03:19:24 2023 From: gli at openjdk.org (Guoxiong Li) Date: Mon, 11 Dec 2023 03:19:24 GMT Subject: RFR: 8321688: Build on linux with GCC 7.5.0 fails after 8319577 Message-ID: Hi all, This patch fixes the building failure introduced by [JDK-8319577](https://bugs.openjdk.org/browse/JDK-8319577) in old GCC version (linux & GCC 7.5.0 locally). Thanks for the review. Best Regards, -- Guoxiong ------------- Commit messages: - JDK-8321688 Changes: https://git.openjdk.org/jdk/pull/17047/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17047&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8321688 Stats: 4 lines in 2 files changed: 0 ins; 2 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/17047.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17047/head:pull/17047 PR: https://git.openjdk.org/jdk/pull/17047 From kbarrett at openjdk.org Mon Dec 11 03:45:15 2023 From: kbarrett at openjdk.org (Kim Barrett) Date: Mon, 11 Dec 2023 03:45:15 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. This is effectively creating a new port. That shouldn't be done lightly. Who needs this? (Real question, not rhetorical.) We've discussed things like this in the past (build for Windows using something other than MSVC), and it wasn't clear there was a user community sufficient to warrant the effort to develop and (especially) maintain such a port. Who is going to maintain this? Most "secondary" ports have an associated JDK project that is responsible for them. This provides a place for other developers to find the maintainers. Because there was only the one configuration, there have been places that conflate Windows (the OS) and MSVC (the compiler), both in the build system and in the source code. And for source code that means both HotSpot and native code elsewhere in the JDK. Julian has been cleaning up some of that, but I've no idea how much might be left. And things will quickly bit rot if there aren't active maintainers. ------------- PR Review: https://git.openjdk.org/jdk/pull/17019#pullrequestreview-1774237983 From djelinski at openjdk.org Mon Dec 11 08:48:13 2023 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Mon, 11 Dec 2023 08:48:13 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: <4oA8th3ee_dRC0UfUrvzbO1sWamIw_WGZGZDyoZsEZU=.494c878a-f30b-4dbc-86a5-ba7964780958@github.com> On Mon, 11 Dec 2023 03:42:21 GMT, Kim Barrett wrote: >> I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. >> >> Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. >> >> Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. >> >> In order to use the clang compiler: >> - install Visual Studio 2022 >> - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) >> - configure `--with-toolchain-type=clcl` >> - compile as usual. >> >> Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. > > This is effectively creating a new port. That shouldn't be done lightly. > > Who needs this? (Real question, not rhetorical.) We've discussed things like > this in the past (build for Windows using something other than MSVC), and it > wasn't clear there was a user community sufficient to warrant the effort to > develop and (especially) maintain such a port. > > Who is going to maintain this? > > Most "secondary" ports have an associated JDK project that is responsible for > them. This provides a place for other developers to find the maintainers. > > Because there was only the one configuration, there have been places that > conflate Windows (the OS) and MSVC (the compiler), both in the build system > and in the source code. And for source code that means both HotSpot and > native code elsewhere in the JDK. Julian has been cleaning up some of that, > but I've no idea how much might be left. And things will quickly bit rot if > there aren't active maintainers. Thanks @kimbarrett for your input. I'm not aware of anyone who needs this. I am using clang only for the warnings it reports. It found a number of previously undetected problems. If new compilers are added on a strictly as-needed basis, this one has no place in the JDK; the Structured Exception Handling implementation in clang is sub-standard, and a hack is required to make it work. The resulting artifacts pass the tests I'm interested in, but I have no intention of running the entire test suite. I'm only providing this patch to make it easier for others to experiment with clang-cl. If that's not a good enough reason to get this patch merged, I can keep maintaining it in my fork. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1849568982 From aph-open at littlepinkcloud.com Mon Dec 11 09:24:34 2023 From: aph-open at littlepinkcloud.com (Andrew Haley) Date: Mon, 11 Dec 2023 09:24:34 +0000 Subject: Cross compilation discussion In-Reply-To: <6f40d377-1f06-42ce-a417-27c99bdbf76c@oracle.com> References: <789dcb6f-e326-4be6-ba49-0e50e9251e98@littlepinkcloud.com> <5daf61ab-13c4-4c6c-9e03-ddef27c744de@oracle.com> <6f40d377-1f06-42ce-a417-27c99bdbf76c@oracle.com> Message-ID: On 12/8/23 20:36, erik.joelsson at oracle.com wrote: > > On 12/8/23 08:29, Magnus Ihse Bursie wrote: >> >>> OK. So you are doing what I'd usually call cross compiling, sort of, but >>> you don't want to treat it as a cross-compiled build. It's an unusual >>> case, in that it is cross compiled, but it is also expected to be >>> able to >>> run on the build system. >> >> The main reason for the build to know if we're doing a >> cross-compilation or not has been if we need a special compiler to >> create build tools. For me, that is in essence what the >> cross-compilation flag is saying. > > I think the issue now is that automatically figuring out if a separate > compiler is needed or not can be hard. We do it in some cases, but not > in others, and sometimes we get it wrong (as in the linux-aarch64 issue > Mikael recently fixed, where the given tuple didn't exactly match what > config.guess found on the build machine). I think it would be reasonable > to have a configure parameter to control this explicitly. I think so, or to be able to override what the build system deduces from other build parameters. >> So maybe we should have like "cross-compiling-need-build-compiler" and >> "cross-complining-can-use-target-compiler"? >> > Not sure of the naming here, but in essence, that's where we are making > implicit assumptions today that are hard to control. > > If you specify --with-openjdk-target and the tuple is different than the > build tuple, then we can assume the default is to need a build compiler, > but there are cases where that is still not strictly needed. If > --with-build-devkit is supplied, then that is also a good indication as > we are given an explicit build compiler. Just supplying a sysroot/devkit > should probably not be assumed as needing a build compiler, but paired > with a suitable option, this could support the cross compile to EL8 from > EL7. I could for instance imagine setting --with-build-sysroot=/ to help > nudge configure into defining a separate build compiler, but maybe > that's too clunky? Maybe, or at least fails the principle of least surprise. I think I may be missing something important here: what is the downside of treating a build as a cross compilation? Is it simply that more work has to be done, or something else? -- Andrew Haley (he/him) Java Platform Lead Engineer Red Hat UK Ltd. https://keybase.io/andrewhaley EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671 From redestad at openjdk.org Mon Dec 11 11:32:13 2023 From: redestad at openjdk.org (Claes Redestad) Date: Mon, 11 Dec 2023 11:32:13 GMT Subject: RFR: 8316657: Support whitebox testing in microbenchmarks In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 16:12:27 GMT, Magnus Ihse Bursie wrote: >> The need to use whitebox-testing (wb.jar) from JMH microbenchmarks has recently arisen. > > make/RunTests.gmk line 598: > >> 596: endif >> 597: >> 598: # Set paths for dependencies > > @cl4es So basically this is the line you're objecting to? > > I can remove the change in RunTests.gmk for this patch. That way the wb.jar will be available, but additional work is needed for the micros to access it. But that might, as you say, perhaps be solved within the micros themselves, by annotations or whatever. > > Does that sound reasonable? More reasonable, yes. If we need to pack the wb.jar into the benchmarks.jar or can reference it from the test image dir remains to be seen, but it would be the responsibility of those micros that need it to set that up. While a fully self-contained solution might be preferred for simplicity, we can assume that our test harnesses have access to the test image and can pull in the associated wb.jar from there if needed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16996#discussion_r1422334583 From jwaters at openjdk.org Mon Dec 11 12:54:14 2023 From: jwaters at openjdk.org (Julian Waters) Date: Mon, 11 Dec 2023 12:54:14 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: <9W-7q8kBfAHQeZ-fo4mk9n36cr5FZOug6XOHLEMHuGw=.4087570b-dba6-4477-880c-ba27e8ed3219@github.com> On Fri, 8 Dec 2023 23:17:29 GMT, Magnus Ihse Bursie wrote: > > > we need to design the integration of clang-cl in a way that we can (hopefully) reuse existing clang warning disables. > > > > > > I'd love that. Got any preferences on how that should be handled? > > Not straight out of my hat, no. I wonder what would happen as a first step if we started looking at the DISABLE_WARNINGS_clang fields, by just using a hack. I'm guessing this will take some experimenting. How about having clang-cl be one of the clang names recognized for Windows in addition to regular clang, much like how AIX has ibm-clang_r as its TOOLCHAIN_CC_BINARY_clang rather than the default of just clang? I don't know how clang-cl's options differ from the regular clang however, so I don't know how feasible this approach would be > Julian has been cleaning up some of that, > but I've no idea how much might be left. Quite a bit, I'm afraid ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1850018336 From ihse at openjdk.org Mon Dec 11 13:47:26 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 11 Dec 2023 13:47:26 GMT Subject: RFR: 8316657: Support whitebox testing in microbenchmarks [v2] In-Reply-To: References: Message-ID: > The need to use whitebox-testing (wb.jar) from JMH microbenchmarks has recently arisen. Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: Revert change in RunTests ------------- Changes: - all: https://git.openjdk.org/jdk/pull/16996/files - new: https://git.openjdk.org/jdk/pull/16996/files/320a911d..9e394618 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=16996&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16996&range=00-01 Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/16996.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16996/head:pull/16996 PR: https://git.openjdk.org/jdk/pull/16996 From erik.joelsson at oracle.com Mon Dec 11 13:56:39 2023 From: erik.joelsson at oracle.com (erik.joelsson at oracle.com) Date: Mon, 11 Dec 2023 05:56:39 -0800 Subject: Cross compilation discussion In-Reply-To: References: <789dcb6f-e326-4be6-ba49-0e50e9251e98@littlepinkcloud.com> <5daf61ab-13c4-4c6c-9e03-ddef27c744de@oracle.com> <6f40d377-1f06-42ce-a417-27c99bdbf76c@oracle.com> Message-ID: <3d405183-d7c5-4f0b-b5b6-95d90126cd94@oracle.com> On 12/11/23 01:24, Andrew Haley wrote: > Maybe, or at least fails the principle of least surprise. I think I may > be missing something important here: what is the downside of treating a > build as a cross compilation? Is it simply that more work has to be done, > or something else? > Yes, the drawback is that significantly more work has to be done. If we cannot use the target JDK as "build JDK" to run tools like jmod and jlink, we need to either supply a build JDK or produce one during the build. This means building minimally viable JDK for the build platform, including libjvm and some other native libs and launchers. /Erik From redestad at openjdk.org Mon Dec 11 14:16:15 2023 From: redestad at openjdk.org (Claes Redestad) Date: Mon, 11 Dec 2023 14:16:15 GMT Subject: RFR: 8316657: Support whitebox testing in microbenchmarks [v2] In-Reply-To: References: Message-ID: On Mon, 11 Dec 2023 13:47:26 GMT, Magnus Ihse Bursie wrote: >> The need to use whitebox-testing (wb.jar) from JMH microbenchmarks has recently arisen. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Revert change in RunTests This is ok. Enables WB as a compile-time dependency, but leaves it to the author of WB-dependent tests to either add it as a runtime dependency explicitly or work on a solution to have JMH run forks with the WB dependency added. ------------- Marked as reviewed by redestad (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/16996#pullrequestreview-1775234453 From ihse at openjdk.org Mon Dec 11 14:20:30 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 11 Dec 2023 14:20:30 GMT Subject: Integrated: 8316657: Support whitebox testing in microbenchmarks In-Reply-To: References: Message-ID: On Wed, 6 Dec 2023 15:32:14 GMT, Magnus Ihse Bursie wrote: > The need to use whitebox-testing (wb.jar) from JMH microbenchmarks has recently arisen. This pull request has now been integrated. Changeset: 486594d4 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/486594d4273e9d5a8db43de861e3ca3ce823f0da Stats: 58 lines in 3 files changed: 40 ins; 7 del; 11 mod 8316657: Support whitebox testing in microbenchmarks Reviewed-by: erikj, redestad ------------- PR: https://git.openjdk.org/jdk/pull/16996 From ihse at openjdk.org Mon Dec 11 14:23:19 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 11 Dec 2023 14:23:19 GMT Subject: RFR: JDK-8321621: Update JCov version to 3.0.16 In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 22:42:42 GMT, Alexandre Iline wrote: > JCov support for byte code version 67. Marked as reviewed by ihse (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/17041#pullrequestreview-1775249715 From ihse at openjdk.org Mon Dec 11 14:36:15 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 11 Dec 2023 14:36:15 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: <4rbfOThp0nGiqE1xu428T-tOeniWGWjQKTBW7DzD8qs=.39b2a6ab-cd99-494d-a05a-0877e0a360ec@github.com> On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. I tend to agree with both Camp Kim and Camp David/Julian here. In many ways, the code gets healthier the more variation we have, i terms of support for operating systems, architectures, compilers and C libraries. Both the actual code base gets more exposure which can force out bugs that were lurking in the dark, and the build system gets a requirement for clear separations and structure. So in general, I like to see more compilers and platforms in the JDK! But, then there is Kim's argument about maintenance cost. And it is not to be taken lightly. If the port can be "sneaked in" without much effort or impact on other code, then it essentially free, and even if it is not strictly needed, or we do not have an active maintainer, I see no problem with using it. Great examples of this would be the zero ports on odd CPUs, like MIPS. The more the port interferes with existing code, the higher this barrier becomes. But there is also a second cost associated with new ports (I'm counting the new compiler as a port, in this context), and that is the arbitrary differences that do not bring forth any solved bugs, or good abstractions. All these "#ifdef on_this_platform do_it_that_way". If you need many such changes, this also raises the barrier for inclusion. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1850201488 From ihse at openjdk.org Mon Dec 11 14:40:15 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 11 Dec 2023 14:40:15 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. So, in this case, I believe that if it is possible to reuse warnings from "normal" clang, and the rest of the build process from the existing microsoft-cl toolchain, then the impact might be very small in the code. But it will require some surgery in the toolchain logic, to separate the actual compiler from the rest of the toolchain. It can certainly be done, but might take a few iterations back and forth to get it right. But maybe that's the sort of thing that @TheShermanTanker enjoys? So my verdict is that we can't really accept this PR as it is, but using microsoft-clang is definitely an interesting experiment, and we should lay the groundwork for being able to implement it in a proper fashion. And if it then actually can be implemented with minimal impact to existing code, then we should do it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1850208130 From magnus.ihse.bursie at oracle.com Mon Dec 11 15:21:55 2023 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Mon, 11 Dec 2023 16:21:55 +0100 Subject: Cross compilation discussion In-Reply-To: References: <789dcb6f-e326-4be6-ba49-0e50e9251e98@littlepinkcloud.com> <5daf61ab-13c4-4c6c-9e03-ddef27c744de@oracle.com> <6f40d377-1f06-42ce-a417-27c99bdbf76c@oracle.com> Message-ID: <04128de0-c2b7-44ac-9015-de5179029291@oracle.com> On 2023-12-11 10:24, Andrew Haley wrote: > On 12/8/23 20:36, erik.joelsson at oracle.com wrote: >> >> On 12/8/23 08:29, Magnus Ihse Bursie wrote: >>> >>>> OK. So you are doing what I'd usually call cross compiling, sort >>>> of, but >>>> you don't want to treat it as a cross-compiled build. It's an unusual >>>> case, in that it is cross compiled, but it is also expected to be >>>> able to >>>> run on the build system. >>> >>> The main reason for the build to know if we're doing a >>> cross-compilation or not has been if we need a special compiler to >>> create build tools. For me, that is in essence what the >>> cross-compilation flag is saying. > > >> I think the issue now is that automatically figuring out if a separate >> compiler is needed or not can be hard. We do it in some cases, but not >> in others, and sometimes we get it wrong (as in the linux-aarch64 issue >> Mikael recently fixed, where the given tuple didn't exactly match what >> config.guess found on the build machine). I think it would be reasonable >> to have a configure parameter to control this explicitly. > > I think so, or to be able to override what the build system deduces from > other build parameters. Like everything else in configure, we should try to make automatic deduction of sane default values, but allow the user to override completely if necessary. > >>> So maybe we should have like "cross-compiling-need-build-compiler" and >>> "cross-complining-can-use-target-compiler"? >>> >> Not sure of the naming here, but in essence, that's where we are making >> implicit assumptions today that are hard to control. >> >> If you specify --with-openjdk-target and the tuple is different than the >> build tuple, then we can assume the default is to need a build compiler, >> but there are cases where that is still not strictly needed. If >> --with-build-devkit is supplied, then that is also a good indication as >> we are given an explicit build compiler. Just supplying a sysroot/devkit >> should probably not be assumed as needing a build compiler, but paired >> with a suitable option, this could support the cross compile to EL8 from >> EL7. I could for instance imagine setting --with-build-sysroot=/ to help >> nudge configure into defining a separate build compiler, but maybe >> that's too clunky? > > Maybe, or at least fails the principle of least surprise. I think I may > be missing something important here: what is the downside of treating a > build as a cross compilation? Is it simply that more work has to be done, > or something else? The real downside is if we decide that we need a build jdk, then we need to build the JDK twice. Apart from that, I think it is mostly that it complicates the configuration. I'm trying to imagine what would happen if we say we are doing a cross-compile but set the sysroot to /, and set the build toolchain and the target toolchain to the same native tools. I don't think there would be any other negative effects. But maybe I'm forgetting something... /Magnus From luhenry at openjdk.org Mon Dec 11 18:28:44 2023 From: luhenry at openjdk.org (Ludovic Henry) Date: Mon, 11 Dec 2023 18:28:44 GMT Subject: RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v6] In-Reply-To: References: <3cK9QjVQNIgZoWWhrWKEb3XxfbLjprjRMBbStWegH7M=.6df92651-b97d-445a-aa42-302ea791bbea@github.com> Message-ID: On Mon, 4 Dec 2023 11:58:55 GMT, Magnus Ihse Bursie wrote: > I can't say anything for sure, but I picked up some positive vibes from our internal chat. I think the idea was that libsleef could potentially cover up vector math for all platforms that the current Intel lib solution is missing (basically, everything but linux+windows x64). So I this can be seen as a bit of a trial balloon if it is worth a more complete integration of libsleef in the JDK. I can add that we are interested to use that for Linux + RISC-V support given the RISC-V support was recently merged into sleef upstream. https://github.com/shibatch/sleef/pull/477 ------------- PR Comment: https://git.openjdk.org/jdk/pull/16234#issuecomment-1850636984 From djelinski at openjdk.org Tue Dec 12 14:19:32 2023 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Tue, 12 Dec 2023 14:19:32 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Mon, 11 Dec 2023 14:37:35 GMT, Magnus Ihse Bursie wrote: >> I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. >> >> Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. >> >> Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. >> >> In order to use the clang compiler: >> - install Visual Studio 2022 >> - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) >> - configure `--with-toolchain-type=clcl` >> - compile as usual. >> >> Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. > > So, in this case, I believe that if it is possible to reuse warnings from "normal" clang, and the rest of the build process from the existing microsoft-cl toolchain, then the impact might be very small in the code. But it will require some surgery in the toolchain logic, to separate the actual compiler from the rest of the toolchain. > > It can certainly be done, but might take a few iterations back and forth to get it right. But maybe that's the sort of thing that @TheShermanTanker enjoys? > > So my verdict is that we can't really accept this PR as it is, but using microsoft-clang is definitely an interesting experiment, and we should lay the groundwork for being able to implement it in a proper fashion. And if it then actually can be implemented with minimal impact to existing code, then we should do it. @magicus just to make sure we are talking about the same thing, are you suggesting configuring the compiler separately from the toolchain, using something like `--with-toolchain=microsoft --with-compiler=clang-cl`? Technically that could work. It still doesn't address the argument that no organization is going to take up the task of maintaining this setup. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1852123265 From ihse at openjdk.org Tue Dec 12 14:32:25 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 12 Dec 2023 14:32:25 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. Yes, something like that, I guess. That's the best way I see towards modelling the change that occurs when cl.exe is replaced with clang-cl.exe. I have not really thought about the details, but the "toolchain" concept has been a bit loose, basically from day 1. For instance, "clang" might mean "clang on linux" or "clang as part of Xcode", and sometimes we really have meant the latter but expressed it like it included the former also. We have had a very simple world to model before, where we have had basically 1 os <-> 1 toolchain <-> 1 compiler: * linux - "gnu toolchain" - gcc * macOS - Xcode - clang * windows - visual studio/windows sdk - cl This has allowed us to be sloppy on exactly what we mean. In some cases we have started to tighten up the distinction between os and compiler+toolchain, but we have not really addressed the situation where the compiler is separate from the rest of the toolchain, even though we have had two such cases (originally, gcc was used alongside clang on macOS, and currently, clang is supported as an alternative to gcc on linux). So I do not know how we should express it as a command line, or how much change is needed in the code base, but yeah, something like that... ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1852147287 From djelinski at openjdk.org Tue Dec 12 15:07:44 2023 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Tue, 12 Dec 2023 15:07:44 GMT Subject: RFR: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. Thanks for the discussion. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17019#issuecomment-1852218648 From djelinski at openjdk.org Tue Dec 12 15:07:45 2023 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Tue, 12 Dec 2023 15:07:45 GMT Subject: Withdrawn: 8321533: Clang build for Windows In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 15:52:46 GMT, Daniel Jeli?ski wrote: > I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend. > > Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition. > > Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality. > > In order to use the clang compiler: > - install Visual Studio 2022 > - install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170) > - configure `--with-toolchain-type=clcl` > - compile as usual. > > Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/17019 From ihse at openjdk.org Tue Dec 12 15:45:57 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 12 Dec 2023 15:45:57 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> <7_T6sM3wjbSzZ0ab9FsptbpPnlQ2J4NNctQNkdbDFdI=.b595a8cc-4b14-44c6-8319-00e68fea21c3@github.com> Message-ID: On Wed, 6 Dec 2023 17:20:10 GMT, Srinivas Vamsi Parasa wrote: >> Okay, then I guess I am fine with this. > > Thank you Magnus! @vamsi-parasa You said: > Made sure that OpenJDK builds without errors using both GCC 7.5 and GCC 6.4. but now we have https://bugs.openjdk.org/browse/JDK-8321688. Did you introduce any changes after you tested with GCC 7.5? It seems strange to me that the code simultaneously both works and not works with gcc 7.5. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1424200521 From duke at openjdk.org Tue Dec 12 17:36:55 2023 From: duke at openjdk.org (Srinivas Vamsi Parasa) Date: Tue, 12 Dec 2023 17:36:55 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> <7_T6sM3wjbSzZ0ab9FsptbpPnlQ2J4NNctQNkdbDFdI=.b595a8cc-4b14-44c6-8319-00e68fea21c3@github.com> Message-ID: On Tue, 12 Dec 2023 15:42:09 GMT, Magnus Ihse Bursie wrote: >> Thank you Magnus! > > @vamsi-parasa You said: >> Made sure that OpenJDK builds without errors using both GCC 7.5 and GCC 6.4. > > but now we have https://bugs.openjdk.org/browse/JDK-8321688. Did you introduce any changes after you tested with GCC 7.5? It seems strange to me that the code simultaneously both works and not works with gcc 7.5. Hi Magnus (@magicus), did a fresh pull of the OpenJDK and was able to build it successfully (without any errors) using GCC 7.5.0 on Ubuntu Linux machine. (I am on vacation till Jan7th, 2024. Our team will look into this issue) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1424352122 From shurailine at openjdk.org Tue Dec 12 20:44:40 2023 From: shurailine at openjdk.org (Alexandre Iline) Date: Tue, 12 Dec 2023 20:44:40 GMT Subject: Integrated: JDK-8321621: Update JCov version to 3.0.16 In-Reply-To: References: Message-ID: On Fri, 8 Dec 2023 22:42:42 GMT, Alexandre Iline wrote: > JCov support for byte code version 67. This pull request has now been integrated. Changeset: d5a96e3f Author: Alexandre Iline URL: https://git.openjdk.org/jdk/commit/d5a96e3f490ba9591f61b23dc2b06e65b0098140 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8321621: Update JCov version to 3.0.16 Reviewed-by: erikj, alanb, ihse ------------- PR: https://git.openjdk.org/jdk/pull/17041 From erikj at openjdk.org Tue Dec 12 21:34:40 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Tue, 12 Dec 2023 21:34:40 GMT Subject: Integrated: 8321557: Move SOURCE line verification for OracleJDK out of OpenJDK In-Reply-To: References: Message-ID: On Thu, 7 Dec 2023 23:29:48 GMT, Erik Joelsson wrote: > The main goal of this patch is to remove the OracleJDK specific verification of the SOURCE field in the release file from the OpenJDK test. While at it, I decided to do some cleanup as well to make the code a bit more modern and less unnecessarily verbose. This pull request has now been integrated. Changeset: 5463c9cd Author: Erik Joelsson URL: https://git.openjdk.org/jdk/commit/5463c9cd9a0a6f95f90787c330679b2ea78690c6 Stats: 70 lines in 1 file changed: 8 ins; 39 del; 23 mod 8321557: Move SOURCE line verification for OracleJDK out of OpenJDK Reviewed-by: ihse ------------- PR: https://git.openjdk.org/jdk/pull/17027 From ihse at openjdk.org Wed Dec 13 09:52:02 2023 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 13 Dec 2023 09:52:02 GMT Subject: RFR: 8319577: x86_64 AVX2 intrinsics for Arrays.sort methods (int, float arrays) [v12] In-Reply-To: References: <_gSNXk0qGAtpY-WJ5OCHk_3-nuGrwwSn-ffK9f2TEcs=.40f785ba-83dd-40fe-8075-a7a7872ea600@github.com> <7_T6sM3wjbSzZ0ab9FsptbpPnlQ2J4NNctQNkdbDFdI=.b595a8cc-4b14-44c6-8319-00e68fea21c3@github.com> Message-ID: On Tue, 12 Dec 2023 17:33:12 GMT, Srinivas Vamsi Parasa wrote: >> @vamsi-parasa You said: >>> Made sure that OpenJDK builds without errors using both GCC 7.5 and GCC 6.4. >> >> but now we have https://bugs.openjdk.org/browse/JDK-8321688. Did you introduce any changes after you tested with GCC 7.5? It seems strange to me that the code simultaneously both works and not works with gcc 7.5. > > Hi Magnus (@magicus), did a fresh pull of the OpenJDK and was able to build it successfully (without any errors) using GCC 7.5.0 on Ubuntu Linux machine. > (I am on vacation till Jan7th, 2024. Our team will look into this issue) New information in JDK-8321688 says it is only happening on slowdebug. This is probably why it was missed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16534#discussion_r1425106097 From hannesw at openjdk.org Thu Dec 14 17:20:07 2023 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Thu, 14 Dec 2023 17:20:07 GMT Subject: RFR: JDK-8320458: Improve structural navigation in API documentation Message-ID: This is a rather big change to update the structural navigation in API documentation generated by JavaDoc. It adds a table of contents for the current page to module, package, and class documentation, and replaces the old sub-navigation bar with a breadcrumb-style links in those pages. The table of contents is displayed as sidebar on wide/desktop displays and integrated into the collapsible menu for narrow/mobile displays. The generated docs can be browsed here: https://cr.openjdk.org/~hannesw/8320458/api.00/ This change includes improvements in `stylesheet.css` and `script.js` that are not strictly related to the navigation changes, but happened as a consequence of the necessary restructuring. All these are described together with the more on-topic changes in the list below. - The table of contents is composed as the respective writers generate the pages. For this purpose, `HtmlDocletWriter` has a new `tocBuilder` field of new type `ListBuilder`. If the field is not `null` it is used to build the table of contents as the page is built using either one of the new`HtmlDocletWriter.addToTableOfContents` methods or the `ListBuilder` directly. - Once the TOC is built, `HtmlDocletWriter.getSideBar` is used to generate the markup for the sidebar and it is added to the page via the `BodyContents.setSideContent` method. - Both existing navigation bars (top and sub-navigation) get an additional `
` container with CSS class `nav-content` that uses a flex layout for its content. This also handles vertical positioning, so the old workaround for vertical of the language version label in `Docs.gmk` is not necessary anymore. - Apart from modules, packages, and classes, other pages that were converted to obtain a table of contents are the "Constant Field Values" page and the Help page. - Originally, I used the `