On Sun, 10 May 2026 03:53:18 GMT, Ashutosh Mehra <[email protected]> wrote:

>> VM has a hardcoded requirement on the hardware to have support for SSE2. 
>> Without SSE2, VM won't even startup. Therefore there is no need to 
>> explicitly check for SSE2 and/or SSE support, after the initial hardcoded 
>> check for SSE2.
>> This patch clean up the such redundant checks for `supports_sse2()` and 
>> `supports_sse()`.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Ashutosh Mehra has updated the pull request incrementally with three 
> additional commits since the last revision:
> 
>  - Add required header file
>    
>    Signed-off-by: Ashutosh Mehra <[email protected]>
>  - Fix another test
>    
>    Signed-off-by: Ashutosh Mehra <[email protected]>
>  - Fix tests to not use -XX:UseSSE=0 or -XX:UseSSE=1
>    
>    Signed-off-by: Ashutosh Mehra <[email protected]>

Couple more tests worth cleaning up:

diff --git 
a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java 
b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java
index 5b1d6f51bb3..4520f45a47a 100644
--- a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java
+++ b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java
@@ -29,8 +29,7 @@
  * @test
  * @bug 8279258
  * @summary Auto-vectorization enhancement for two-dimensional array operations
- * @requires (os.arch != "x86" & os.arch != "i386" & os.arch != "ppc64" & 
os.arch != "ppc64le" & os.arch != "riscv64")
- *           | ((os.arch == "x86" | os.arch == "i386") & (vm.opt.UseSSE == 
"null" | vm.opt.UseSSE >= 2))
+ * @requires (os.arch != "ppc64" & os.arch != "ppc64le" & os.arch != "riscv64")
  *           | ((os.arch == "ppc64" | os.arch == "ppc64le") & vm.cpu.features 
~= ".*darn.*")
  *           | (os.arch == "riscv64" & vm.cpu.features ~= ".*rvv.*")
  * @library /test/lib /

diff --git a/test/hotspot/jtreg/compiler/floatingpoint/NaNTest.java 
b/test/hotspot/jtreg/compiler/floatingpoint/NaNTest.java
index 959647014ca..ee0c17beaa1 100644
--- a/test/hotspot/jtreg/compiler/floatingpoint/NaNTest.java
+++ b/test/hotspot/jtreg/compiler/floatingpoint/NaNTest.java
@@ -73,35 +73,7 @@ static void testDouble() {
     }
 
     public static void main(String args[]) {
-        // Some platforms are known to strip signaling NaNs.
-        // The block below can be used to except them.
-        boolean expectStableFloats = true;
-        boolean expectStableDoubles = true;
-
-        // On x86_32 without relevant SSE-enabled stubs, we are entering
-        // native methods that use FPU instructions, and those strip the
-        // signaling NaNs.
-        if (Platform.isX86()) {
-            int sse = WHITE_BOX.getIntVMFlag("UseSSE").intValue();
-            boolean stubsPresent = 
WHITE_BOX.getBooleanVMFlag("InlineIntrinsics");
-            expectStableFloats = (sse >= 1) && stubsPresent;
-            expectStableDoubles = (sse >= 2) && stubsPresent;
-        }
-
-        if (expectStableFloats) {
-           testFloat();
-        } else {
-           System.out.println("Stable floats cannot be expected, skipping");
-        }
-
-        if (expectStableDoubles) {
-           testDouble();
-        } else {
-           System.out.println("Stable doubles cannot be expected, skipping");
-        }
-
-        if (!expectStableFloats && !expectStableDoubles) {
-           throw new SkippedException("No tests were run.");
-        }
+       testFloat();
+       testDouble();
     }
 }

test/hotspot/jtreg/compiler/c1/Test6579789.java line 29:

> 27:  * @summary Internal error "c1_LinearScan.cpp:1429 Error: 
> assert(false,"")" in debuggee with fastdebug VM
> 28:  *
> 29:  * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:UseSSE=0

I suggest to force it to minimally supported configuration instead 
(`-XX:UseSSE=2`).

test/hotspot/jtreg/compiler/c1/Test6855215.java line 29:

> 27:  * @summary Calculation error (NaN) after about 1500 calculations
> 28:  *
> 29:  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions 
> -XX:UseSSE=0 compiler.c1.Test6855215

Same here.

-------------

PR Review: https://git.openjdk.org/jdk/pull/31045#pullrequestreview-4266045228
PR Review Comment: https://git.openjdk.org/jdk/pull/31045#discussion_r3220983315
PR Review Comment: https://git.openjdk.org/jdk/pull/31045#discussion_r3220984714

Reply via email to