From e080a0b4c0878dc19f40ef0f51e645f3a4708c62 Mon Sep 17 00:00:00 2001 From: Axel Boldt-Christmas Date: Thu, 10 Aug 2023 07:18:31 +0000 Subject: [PATCH 001/162] 8311508: ZGC: RAII use of IntelJccErratumAlignment Reviewed-by: stefank, shade, tschatzl --- src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp | 1 + src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp | 2 +- src/hotspot/cpu/x86/gc/z/z_x86_64.ad | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp b/src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp index 6cfa2ce1a31..fce09c31b9c 100644 --- a/src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp +++ b/src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp @@ -146,5 +146,6 @@ IntelJccErratumAlignment::~IntelJccErratumAlignment() { return; } + assert(pc() - _start_pc > 0, "No instruction aligned"); assert(!IntelJccErratum::is_crossing_or_ending_at_32_byte_boundary(_start_pc, pc()), "Invalid jcc_size estimate"); } diff --git a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp index 6cd584b4aca..6cb16a09d55 100644 --- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp @@ -356,7 +356,7 @@ static void emit_store_fast_path_check_c2(MacroAssembler* masm, Address ref_addr // This is a JCC erratum mitigation wrapper for calling the inner check int size = store_fast_path_check_size(masm, ref_addr, is_atomic, medium_path); // Emit JCC erratum mitigation nops with the right size - IntelJccErratumAlignment(*masm, size); + IntelJccErratumAlignment intel_alignment(*masm, size); // Emit the JCC erratum mitigation guarded code emit_store_fast_path_check(masm, ref_addr, is_atomic, medium_path); #endif diff --git a/src/hotspot/cpu/x86/gc/z/z_x86_64.ad b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad index adb0f3ab8eb..d178805dfc7 100644 --- a/src/hotspot/cpu/x86/gc/z/z_x86_64.ad +++ b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad @@ -74,8 +74,10 @@ static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address return; } ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref); - IntelJccErratumAlignment(_masm, 6); - __ jcc(Assembler::above, *stub->entry()); + { + IntelJccErratumAlignment intel_alignment(_masm, 6); + __ jcc(Assembler::above, *stub->entry()); + } __ bind(*stub->continuation()); } From 8f28809aa87b1026cdbdd1ea88da3c7f0c994697 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Thu, 10 Aug 2023 07:21:47 +0000 Subject: [PATCH 002/162] 8299790: os::print_hex_dump is racy Reviewed-by: shade, dholmes --- src/hotspot/share/runtime/os.cpp | 65 +++++++++++++++++++++----- test/hotspot/gtest/runtime/test_os.cpp | 30 ++++++------ 2 files changed, 68 insertions(+), 27 deletions(-) diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 89511362dc1..08d0b0066f4 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -928,13 +928,58 @@ bool os::print_function_and_library_name(outputStream* st, return have_function_name || have_library_name; } -ATTRIBUTE_NO_ASAN static void print_hex_readable_pointer(outputStream* st, address p, - int unitsize) { - switch (unitsize) { - case 1: st->print("%02x", *(u1*)p); break; - case 2: st->print("%04x", *(u2*)p); break; - case 4: st->print("%08x", *(u4*)p); break; - case 8: st->print("%016" FORMAT64_MODIFIER "x", *(u8*)p); break; +ATTRIBUTE_NO_ASAN static bool read_safely_from(intptr_t* p, intptr_t* result) { + const intptr_t errval = 0x1717; + intptr_t i = SafeFetchN(p, errval); + if (i == errval) { + i = SafeFetchN(p, ~errval); + if (i == ~errval) { + return false; + } + } + (*result) = i; + return true; +} + +static void print_hex_location(outputStream* st, address p, int unitsize) { + address pa = align_down(p, sizeof(intptr_t)); +#ifndef _LP64 + // Special handling for printing qwords on 32-bit platforms + if (unitsize == 8) { + intptr_t i1, i2; + if (read_safely_from((intptr_t*)pa, &i1) && + read_safely_from((intptr_t*)pa + 1, &i2)) { + const uint64_t value = + LITTLE_ENDIAN_ONLY((((uint64_t)i2) << 32) | i1) + BIG_ENDIAN_ONLY((((uint64_t)i1) << 32) | i2); + st->print("%016" FORMAT64_MODIFIER "x", value); + } else { + st->print_raw("????????????????"); + } + return; + } +#endif // 32-bit, qwords + intptr_t i = 0; + if (read_safely_from((intptr_t*)pa, &i)) { + const int offset = (int)(p - (address)pa); + const int bitoffset = + LITTLE_ENDIAN_ONLY(offset * BitsPerByte) + BIG_ENDIAN_ONLY((int)(sizeof(intptr_t) - 1 - offset) * BitsPerByte); + const int bitfieldsize = unitsize * BitsPerByte; + intptr_t value = bitfield(i, bitoffset, bitfieldsize); + switch (unitsize) { + case 1: st->print("%02x", (u1)value); break; + case 2: st->print("%04x", (u2)value); break; + case 4: st->print("%08x", (u4)value); break; + case 8: st->print("%016" FORMAT64_MODIFIER "x", (u8)value); break; + } + } else { + switch (unitsize) { + case 1: st->print_raw("??"); break; + case 2: st->print_raw("????"); break; + case 4: st->print_raw("????????"); break; + case 8: st->print_raw("????????????????"); break; + } } } @@ -955,11 +1000,7 @@ void os::print_hex_dump(outputStream* st, address start, address end, int unitsi // Print out the addresses as if we were starting from logical_start. st->print(PTR_FORMAT ": ", p2i(logical_p)); while (p < end) { - if (is_readable_pointer(p)) { - print_hex_readable_pointer(st, p, unitsize); - } else { - st->print("%*.*s", 2*unitsize, 2*unitsize, "????????????????"); - } + print_hex_location(st, p, unitsize); p += unitsize; logical_p += unitsize; cols++; diff --git a/test/hotspot/gtest/runtime/test_os.cpp b/test/hotspot/gtest/runtime/test_os.cpp index fb2ab86a7b9..d44dc3216ee 100644 --- a/test/hotspot/gtest/runtime/test_os.cpp +++ b/test/hotspot/gtest/runtime/test_os.cpp @@ -169,31 +169,31 @@ static void do_test_print_hex_dump(address addr, size_t len, int unitsize, const buf[0] = '\0'; stringStream ss(buf, sizeof(buf)); os::print_hex_dump(&ss, addr, addr + len, unitsize); -// tty->print_cr("expected: %s", expected); -// tty->print_cr("result: %s", buf); - ASSERT_NE(strstr(buf, expected), (char*)NULL); + // tty->print_cr("expected: %s", expected); + // tty->print_cr("result: %s", buf); + EXPECT_THAT(buf, testing::HasSubstr(expected)); } TEST_VM(os, test_print_hex_dump) { const char* pattern [4] = { #ifdef VM_LITTLE_ENDIAN - "00 01 02 03 04 05 06 07", - "0100 0302 0504 0706", - "03020100 07060504", - "0706050403020100" + "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f", + "0100 0302 0504 0706 0908 0b0a 0d0c 0f0e", + "03020100 07060504 0b0a0908 0f0e0d0c", + "0706050403020100 0f0e0d0c0b0a0908" #else - "00 01 02 03 04 05 06 07", - "0001 0203 0405 0607", - "00010203 04050607", - "0001020304050607" + "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f", + "0001 0203 0405 0607 0809 0a0b 0c0d 0e0f", + "00010203 04050607 08090a0b 0c0d0e0f", + "0001020304050607 08090a0b0c0d0e0f" #endif }; const char* pattern_not_readable [4] = { - "?? ?? ?? ?? ?? ?? ?? ??", - "???? ???? ???? ????", - "???????? ????????", - "????????????????" + "?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??", + "???? ???? ???? ???? ???? ???? ???? ????", + "???????? ???????? ???????? ????????", + "???????????????? ????????????????" }; // On AIX, zero page is readable. From 6dba2026d72de6a67aa0209749ded8174b088904 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 10 Aug 2023 07:23:24 +0000 Subject: [PATCH 003/162] 8313670: Simplify shared lib name handling code in some tests Reviewed-by: cjplummer, sspitsyn --- .../jtreg/runtime/signal/SigTestDriver.java | 5 ++- .../AttachFailed/AttachFailedTestBase.java | 11 ++---- .../dcmd/jvmti/LoadAgentDcmdTest.java | 17 ++------- .../serviceability/dcmd/vm/DynLibsTest.java | 24 +++---------- .../nsk/jvmti/NativeLibraryCopier.java | 13 ++----- .../warnings/DynamicLoadWarningTest.java | 5 ++- .../runtime/TestNativeLibrariesEvent.java | 19 ++-------- .../runtime/TestNativeLibraryLoadEvent.java | 36 +++---------------- test/lib/jdk/test/lib/Platform.java | 21 +++++++++++ 9 files changed, 43 insertions(+), 108 deletions(-) diff --git a/test/hotspot/jtreg/runtime/signal/SigTestDriver.java b/test/hotspot/jtreg/runtime/signal/SigTestDriver.java index 6fcc41c8ab2..f2b37af1c39 100644 --- a/test/hotspot/jtreg/runtime/signal/SigTestDriver.java +++ b/test/hotspot/jtreg/runtime/signal/SigTestDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -144,7 +144,6 @@ private static List vmargs() { } private static Path libjsig() { - return Platform.jvmLibDir().resolve((Platform.isWindows() ? "" : "lib") - + "jsig." + Platform.sharedLibraryExt()); + return Platform.jvmLibDir().resolve(Platform.buildSharedLibraryName("jsig")); } } diff --git a/test/hotspot/jtreg/serviceability/dcmd/jvmti/AttachFailed/AttachFailedTestBase.java b/test/hotspot/jtreg/serviceability/dcmd/jvmti/AttachFailed/AttachFailedTestBase.java index d6b1159a4b0..6926ec0fbf7 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/jvmti/AttachFailed/AttachFailedTestBase.java +++ b/test/hotspot/jtreg/serviceability/dcmd/jvmti/AttachFailed/AttachFailedTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,14 +39,7 @@ public abstract class AttachFailedTestBase { * Build path to shared object according to platform rules */ public static String getSharedObjectPath(String name) { - String libname; - if (Platform.isWindows()) { - libname = name + ".dll"; - } else if (Platform.isOSX()) { - libname = "lib" + name + ".dylib"; - } else { - libname = "lib" + name + ".so"; - } + String libname = Platform.buildSharedLibraryName(name); return Paths.get(Utils.TEST_NATIVE_PATH, libname) .toAbsolutePath() diff --git a/test/hotspot/jtreg/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java b/test/hotspot/jtreg/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java index c24b23d09a1..725bf086b3b 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/jvmti/LoadAgentDcmdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,7 @@ public String getLibInstrumentPath() throws FileNotFoundException { "'-Dtest.jdk=/path/to/jdk'."); } - Path libpath = Paths.get(jdkPath, jdkLibPath(), sharedObjectName("instrument")); + Path libpath = Paths.get(jdkPath, jdkLibPath(), Platform.buildSharedLibraryName("instrument")); if (!libpath.toFile().exists()) { throw new FileNotFoundException( @@ -157,19 +157,6 @@ public static String jdkLibPath() { return "lib"; } - /** - * Build name of shared object according to platform rules - */ - public static String sharedObjectName(String name) { - if (Platform.isWindows()) { - return name + ".dll"; - } - if (Platform.isOSX()) { - return "lib" + name + ".dylib"; - } - return "lib" + name + ".so"; - } - @Test public void jmx() throws Throwable { run(new JMXExecutor()); diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/DynLibsTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/DynLibsTest.java index 1593bc164bc..696101a329e 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/DynLibsTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/DynLibsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,25 +44,9 @@ public class DynLibsTest { public void run(CommandExecutor executor) { OutputAnalyzer output = executor.execute("VM.dynlibs"); - - String osDependentBaseString = null; - if (Platform.isAix()) { - osDependentBaseString = "lib%s.so"; - } else if (Platform.isLinux()) { - osDependentBaseString = "lib%s.so"; - } else if (Platform.isOSX()) { - osDependentBaseString = "lib%s.dylib"; - } else if (Platform.isWindows()) { - osDependentBaseString = "%s.dll"; - } - - if (osDependentBaseString == null) { - Assert.fail("Unsupported OS"); - } - - output.shouldContain(String.format(osDependentBaseString, "jvm")); - output.shouldContain(String.format(osDependentBaseString, "java")); - output.shouldContain(String.format(osDependentBaseString, "management")); + output.shouldContain(Platform.buildSharedLibraryName("jvm")); + output.shouldContain(Platform.buildSharedLibraryName("java")); + output.shouldContain(Platform.buildSharedLibraryName("management")); } @Test diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeLibraryCopier.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeLibraryCopier.java index 4f846f997ef..a7a83820621 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeLibraryCopier.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeLibraryCopier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,12 +34,12 @@ public class NativeLibraryCopier { public static void main(String[] args) { Path src = Paths.get(Utils.TEST_NATIVE_PATH) - .resolve(libname(args[0])) + .resolve(Platform.buildSharedLibraryName(args[0])) .toAbsolutePath(); Path dstDir = Paths.get("."); for (int i = 1; i < args.length; ++i) { - Path dst = dstDir.resolve(libname(args[i])).toAbsolutePath(); + Path dst = dstDir.resolve(Platform.buildSharedLibraryName(args[i])).toAbsolutePath(); System.out.println("copying " + src + " to " + dst); try { Files.copy(src, dst); @@ -48,11 +48,4 @@ public static void main(String[] args) { } } } - - private static String libname(String name) { - return String.format("%s%s.%s", - Platform.isWindows() ? "" : "lib", - name, - Platform.sharedLibraryExt()); - } } diff --git a/test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java b/test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java index 970bade3530..dab4d9ac0ce 100644 --- a/test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java +++ b/test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java @@ -79,9 +79,8 @@ class DynamicLoadWarningTest { @BeforeAll static void setup() throws Exception { // get absolute path to JVM TI agents - String prefix = Platform.isWindows() ? "" : "lib"; - String libname1 = prefix + JVMTI_AGENT1_LIB + "." + Platform.sharedLibraryExt(); - String libname2 = prefix + JVMTI_AGENT2_LIB + "." + Platform.sharedLibraryExt(); + String libname1 = Platform.buildSharedLibraryName(JVMTI_AGENT1_LIB); + String libname2 = Platform.buildSharedLibraryName(JVMTI_AGENT2_LIB); jvmtiAgentPath1 = Path.of(Utils.TEST_NATIVE_PATH, libname1).toAbsolutePath().toString(); jvmtiAgentPath2 = Path.of(Utils.TEST_NATIVE_PATH, libname2).toAbsolutePath().toString(); diff --git a/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java b/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java index 77eb0362841..571809ddab4 100644 --- a/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java +++ b/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,25 +70,10 @@ public static void main(String[] args) throws Throwable { } private static List getExpectedLibs() throws Throwable { - String libTemplate = null; - if (Platform.isWindows()) { - libTemplate = "%s.dll"; - } else if (Platform.isOSX()) { - libTemplate = "lib%s.dylib"; - } else if (Platform.isLinux()) { - libTemplate = "lib%s.so"; - } else if (Platform.isAix()) { - libTemplate = "lib%s.so"; - } - - if (libTemplate == null) { - throw new Exception("Unsupported OS"); - } - List libs = new ArrayList(); String[] names = { "jvm", "java", "zip" }; for (String name : names) { - libs.add(String.format(libTemplate, name)); + libs.add(Platform.buildSharedLibraryName(name)); } return libs; } diff --git a/test/jdk/jdk/jfr/event/runtime/TestNativeLibraryLoadEvent.java b/test/jdk/jdk/jfr/event/runtime/TestNativeLibraryLoadEvent.java index 89c7877b6d4..55053e92800 100644 --- a/test/jdk/jdk/jfr/event/runtime/TestNativeLibraryLoadEvent.java +++ b/test/jdk/jdk/jfr/event/runtime/TestNativeLibraryLoadEvent.java @@ -54,43 +54,17 @@ public static void main(String[] args) throws Throwable { System.loadLibrary("instrument"); recording.stop(); - List expectedLibs = getExpectedLibs(); + String expectedLib = Platform.buildSharedLibraryName("instrument"); + boolean expectedLibFound = false; for (RecordedEvent event : Events.fromRecording(recording)) { System.out.println("Event:" + event); String lib = Events.assertField(event, "name").notEmpty().getValue(); Events.assertField(event, "success"); - for (String expectedLib : new ArrayList<>(expectedLibs)) { - if (lib.contains(expectedLib)) { - expectedLibs.remove(expectedLib); - } + if (lib.contains(expectedLib)) { + expectedLibFound = true; } } - assertTrue(expectedLibs.isEmpty(), "Missing libraries:" + expectedLibs.stream().collect(Collectors.joining(", "))); + assertTrue(expectedLibFound, "Missing library " + expectedLib); } } - - private static List getExpectedLibs() throws Throwable { - String libTemplate = null; - if (Platform.isWindows()) { - libTemplate = "%s.dll"; - } else if (Platform.isOSX()) { - libTemplate = "lib%s.dylib"; - } else if (Platform.isLinux()) { - libTemplate = "lib%s.so"; - } else if (Platform.isAix()) { - libTemplate = "lib%s.so"; - } - - if (libTemplate == null) { - throw new Exception("Unsupported OS"); - } - - List libs = new ArrayList(); - String[] names = { "instrument" }; - for (String name : names) { - libs.add(String.format(libTemplate, name)); - } - return libs; - } - } diff --git a/test/lib/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java index c58877c6c5e..25cb8bc3d1e 100644 --- a/test/lib/jdk/test/lib/Platform.java +++ b/test/lib/jdk/test/lib/Platform.java @@ -362,6 +362,27 @@ public static String sharedLibraryExt() { } } + /** + * Returns the usual file prefix of a shared library, e.g. "lib" on linux, empty on windows. + * @return file name prefix + */ + public static String sharedLibraryPrefix() { + if (isWindows()) { + return ""; + } else { + return "lib"; + } + } + + /** + * Returns the usual full shared lib name of a name without prefix and extension, e.g. for jsig + * "libjsig.so" on linux, "jsig.dll" on windows. + * @return the full shared lib name + */ + public static String buildSharedLibraryName(String name) { + return sharedLibraryPrefix() + name + "." + sharedLibraryExt(); + } + /* * Returns name of system variable containing paths to shared native libraries. */ From 35b60f925a4e7e2e3f1ec7c5c1eee60206e7508a Mon Sep 17 00:00:00 2001 From: Per Minborg Date: Thu, 10 Aug 2023 07:57:19 +0000 Subject: [PATCH 004/162] 8298095: Refine implSpec for SegmentAllocator Reviewed-by: mcimadamore --- .../java/lang/foreign/SegmentAllocator.java | 330 ++++++++++++------ 1 file changed, 228 insertions(+), 102 deletions(-) diff --git a/src/java.base/share/classes/java/lang/foreign/SegmentAllocator.java b/src/java.base/share/classes/java/lang/foreign/SegmentAllocator.java index 0c6133750e4..b659e32fa8a 100644 --- a/src/java.base/share/classes/java/lang/foreign/SegmentAllocator.java +++ b/src/java.base/share/classes/java/lang/foreign/SegmentAllocator.java @@ -77,8 +77,7 @@ public interface SegmentAllocator { /** - * Converts a Java string into a UTF-8 encoded, null-terminated C string, - * storing the result into a memory segment. + * {@return a new memory segment with a Java string converted into a UTF-8 encoded, null-terminated C string} *

* This method always replaces malformed-input and unmappable-character * sequences with this charset's default replacement byte array. The @@ -90,10 +89,9 @@ public interface SegmentAllocator { * the string, such as {@link MemorySegment#getUtf8String(long)}, the string * will appear truncated when read again. * - * @implSpec the default implementation for this method copies the contents of the provided Java string + * @implSpec The default implementation for this method copies the contents of the provided Java string * into a new memory segment obtained by calling {@code this.allocate(str.length() + 1)}. * @param str the Java string to be converted into a C string. - * @return a new native segment containing the converted C string. */ default MemorySegment allocateUtf8String(String str) { Objects.requireNonNull(str); @@ -101,198 +99,319 @@ default MemorySegment allocateUtf8String(String str) { } /** - * Allocates a memory segment with the given layout and initializes it with the given byte value. - * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. + * {@return a new memory segment initialized with the provided {@code byte} {@code value} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * MemorySegment seg = allocate(Objects.requireNonNull(layout)); + * seg.set(layout, 0, value); + * return seg; + * } + * * @param layout the layout of the block of memory to be allocated. - * @param value the value to be set on the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param value the value to be set in the newly allocated memory segment. */ default MemorySegment allocate(ValueLayout.OfByte layout, byte value) { Objects.requireNonNull(layout); VarHandle handle = layout.varHandle(); - MemorySegment addr = allocate(layout); - handle.set(addr, value); - return addr; + MemorySegment seg = allocate(layout); + handle.set(seg, value); + return seg; } /** - * Allocates a memory segment with the given layout and initializes it with the given char value. - * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. + * {@return a new memory segment initialized with the provided {@code char} {@code value} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * MemorySegment seg = allocate(Objects.requireNonNull(layout)); + * seg.set(layout, 0, value); + * return seg; + * } + * * @param layout the layout of the block of memory to be allocated. - * @param value the value to be set on the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param value the value to be set in the newly allocated memory segment. */ default MemorySegment allocate(ValueLayout.OfChar layout, char value) { Objects.requireNonNull(layout); VarHandle handle = layout.varHandle(); - MemorySegment addr = allocate(layout); - handle.set(addr, value); - return addr; + MemorySegment seg = allocate(layout); + handle.set(seg, value); + return seg; } /** - * Allocates a memory segment with the given layout and initializes it with the given short value. - * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. + * {@return a new memory segment initialized with the provided {@code short} {@code value} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * MemorySegment seg = allocate(Objects.requireNonNull(layout)); + * seg.set(layout, 0, value); + * return seg; + * } + * * @param layout the layout of the block of memory to be allocated. - * @param value the value to be set on the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param value the value to be set in the newly allocated memory segment. */ default MemorySegment allocate(ValueLayout.OfShort layout, short value) { Objects.requireNonNull(layout); VarHandle handle = layout.varHandle(); - MemorySegment addr = allocate(layout); - handle.set(addr, value); - return addr; + MemorySegment seg = allocate(layout); + handle.set(seg, value); + return seg; } /** - * Allocates a memory segment with the given layout and initializes it with the given int value. - * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. + * {@return a new memory segment initialized with the provided {@code int} {@code value} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * MemorySegment seg = allocate(Objects.requireNonNull(layout)); + * seg.set(layout, 0, value); + * return seg; + * } + * * @param layout the layout of the block of memory to be allocated. - * @param value the value to be set on the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param value the value to be set in the newly allocated memory segment. */ default MemorySegment allocate(ValueLayout.OfInt layout, int value) { Objects.requireNonNull(layout); VarHandle handle = layout.varHandle(); - MemorySegment addr = allocate(layout); - handle.set(addr, value); - return addr; + MemorySegment seg = allocate(layout); + handle.set(seg, value); + return seg; } /** - * Allocates a memory segment with the given layout and initializes it with the given float value. - * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. + * {@return a new memory segment initialized with the provided {@code float} {@code value} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * MemorySegment seg = allocate(Objects.requireNonNull(layout)); + * seg.set(layout, 0, value); + * return seg; + * } + * * @param layout the layout of the block of memory to be allocated. - * @param value the value to be set on the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param value the value to be set in the newly allocated memory segment. */ default MemorySegment allocate(ValueLayout.OfFloat layout, float value) { Objects.requireNonNull(layout); VarHandle handle = layout.varHandle(); - MemorySegment addr = allocate(layout); - handle.set(addr, value); - return addr; + MemorySegment seg = allocate(layout); + handle.set(seg, value); + return seg; } /** - * Allocates a memory segment with the given layout and initializes it with the given long value. - * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. + * {@return a new memory segment initialized with the provided {@code long} {@code value} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * MemorySegment seg = allocate(Objects.requireNonNull(layout)); + * seg.set(layout, 0, value); + * return seg; + * } + * * @param layout the layout of the block of memory to be allocated. - * @param value the value to be set on the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param value the value to be set in the newly allocated memory segment. */ default MemorySegment allocate(ValueLayout.OfLong layout, long value) { Objects.requireNonNull(layout); VarHandle handle = layout.varHandle(); - MemorySegment addr = allocate(layout); - handle.set(addr, value); - return addr; + MemorySegment seg = allocate(layout); + handle.set(seg, value); + return seg; } /** - * Allocates a memory segment with the given layout and initializes it with the given double value. - * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. + * {@return a new memory segment initialized with the provided {@code double} {@code value} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * MemorySegment seg = allocate(Objects.requireNonNull(layout)); + * seg.set(layout, 0, value); + * return seg; + * } + * * @param layout the layout of the block of memory to be allocated. - * @param value the value to be set on the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param value the value to be set in the newly allocated memory segment. */ default MemorySegment allocate(ValueLayout.OfDouble layout, double value) { Objects.requireNonNull(layout); VarHandle handle = layout.varHandle(); - MemorySegment addr = allocate(layout); - handle.set(addr, value); - return addr; + MemorySegment seg = allocate(layout); + handle.set(seg, value); + return seg; } /** - * Allocates a memory segment with the given layout and initializes it with the given address value. + * {@return a new memory segment initialized with the address of the provided {@code value} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + *

* The address value might be narrowed according to the platform address size (see {@link ValueLayout#ADDRESS}). - * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * Objects.requireNonNull(value); + * MemorySegment seg = allocate(Objects.requireNonNull(layout)); + * seg.set(layout, 0, value); + * return seg; + * } + * * @param layout the layout of the block of memory to be allocated. - * @param value the value to be set on the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param value the value to be set in the newly allocated memory segment. */ default MemorySegment allocate(AddressLayout layout, MemorySegment value) { Objects.requireNonNull(value); Objects.requireNonNull(layout); - MemorySegment segment = allocate(layout); - layout.varHandle().set(segment, value); - return segment; + MemorySegment seg = allocate(layout); + layout.varHandle().set(seg, value); + return seg; } /** - * Allocates a memory segment with the given layout and initializes it with the given byte elements. - * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. + * {@return a new memory segment with a {@linkplain MemorySegment#byteSize() byteSize()} of + * {@code E*layout.byteSize()} initialized with the provided {@code E} {@code byte} {@code elements} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * int size = Objects.requireNonNull(elements).length; + * MemorySegment seg = allocateArray(Objects.requireNonNull(elementLayout), size); + * MemorySegment.copy(elements, 0, seg, elementLayout, 0, size); + * return seg; + * } + * * @param elementLayout the element layout of the array to be allocated. - * @param elements the byte elements to be copied to the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param elements the short elements to be copied to the newly allocated memory block. */ default MemorySegment allocateArray(ValueLayout.OfByte elementLayout, byte... elements) { return copyArrayWithSwapIfNeeded(elements, elementLayout, MemorySegment::ofArray); } /** - * Allocates a memory segment with the given layout and initializes it with the given short elements. - * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. + * {@return a new memory segment with a {@linkplain MemorySegment#byteSize() byteSize()} of + * {@code E*layout.byteSize()} initialized with the provided {@code E} {@code short} {@code elements} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * int size = Objects.requireNonNull(elements).length; + * MemorySegment seg = allocateArray(Objects.requireNonNull(elementLayout), size); + * MemorySegment.copy(elements, 0, seg, elementLayout, 0, size); + * return seg; + * } + * * @param elementLayout the element layout of the array to be allocated. - * @param elements the short elements to be copied to the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param elements the short elements to be copied to the newly allocated memory block. */ default MemorySegment allocateArray(ValueLayout.OfShort elementLayout, short... elements) { return copyArrayWithSwapIfNeeded(elements, elementLayout, MemorySegment::ofArray); } /** - * Allocates a memory segment with the given layout and initializes it with the given char elements. - * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. + * {@return a new memory segment with a {@linkplain MemorySegment#byteSize() byteSize()} of + * {@code E*layout.byteSize()} initialized with the provided {@code E} {@code char} {@code elements} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * int size = Objects.requireNonNull(elements).length; + * MemorySegment seg = allocateArray(Objects.requireNonNull(elementLayout), size); + * MemorySegment.copy(elements, 0, seg, elementLayout, 0, size); + * return seg; + * } + * * @param elementLayout the element layout of the array to be allocated. - * @param elements the char elements to be copied to the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param elements the short elements to be copied to the newly allocated memory block. */ default MemorySegment allocateArray(ValueLayout.OfChar elementLayout, char... elements) { return copyArrayWithSwapIfNeeded(elements, elementLayout, MemorySegment::ofArray); } /** - * Allocates a memory segment with the given layout and initializes it with the given int elements. - * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. + * {@return a new memory segment with a {@linkplain MemorySegment#byteSize() byteSize()} of + * {@code E*layout.byteSize()} initialized with the provided {@code E} {@code int} {@code elements} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * int size = Objects.requireNonNull(elements).length; + * MemorySegment seg = allocateArray(Objects.requireNonNull(elementLayout), size); + * MemorySegment.copy(elements, 0, seg, elementLayout, 0, size); + * return seg; + * } + * * @param elementLayout the element layout of the array to be allocated. - * @param elements the int elements to be copied to the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param elements the short elements to be copied to the newly allocated memory block. */ default MemorySegment allocateArray(ValueLayout.OfInt elementLayout, int... elements) { return copyArrayWithSwapIfNeeded(elements, elementLayout, MemorySegment::ofArray); } /** - * Allocates a memory segment with the given layout and initializes it with the given float elements. - * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. + * {@return a new memory segment with a {@linkplain MemorySegment#byteSize() byteSize()} of + * {@code E*layout.byteSize()} initialized with the provided {@code E} {@code float} {@code elements} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * int size = Objects.requireNonNull(elements).length; + * MemorySegment seg = allocateArray(Objects.requireNonNull(elementLayout), size); + * MemorySegment.copy(elements, 0, seg, elementLayout, 0, size); + * return seg; + * } + * * @param elementLayout the element layout of the array to be allocated. - * @param elements the float elements to be copied to the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param elements the short elements to be copied to the newly allocated memory block. */ default MemorySegment allocateArray(ValueLayout.OfFloat elementLayout, float... elements) { return copyArrayWithSwapIfNeeded(elements, elementLayout, MemorySegment::ofArray); } /** - * Allocates a memory segment with the given layout and initializes it with the given long elements. - * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. + * {@return a new memory segment with a {@linkplain MemorySegment#byteSize() byteSize()} of + * {@code E*layout.byteSize()} initialized with the provided {@code E} {@code long} {@code elements} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * int size = Objects.requireNonNull(elements).length; + * MemorySegment seg = allocateArray(Objects.requireNonNull(elementLayout), size); + * MemorySegment.copy(elements, 0, seg, elementLayout, 0, size); + * return seg; + * } + * * @param elementLayout the element layout of the array to be allocated. - * @param elements the long elements to be copied to the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param elements the short elements to be copied to the newly allocated memory block. */ default MemorySegment allocateArray(ValueLayout.OfLong elementLayout, long... elements) { return copyArrayWithSwapIfNeeded(elements, elementLayout, MemorySegment::ofArray); } /** - * Allocates a memory segment with the given layout and initializes it with the given double elements. - * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. + * {@return a new memory segment with a {@linkplain MemorySegment#byteSize() byteSize()} of + * {@code E*layout.byteSize()} initialized with the provided {@code E} {@code double} {@code elements} as + * specified by the provided {@code layout} (i.e. byte ordering, alignment and size)} + * + * @implSpec The default implementation is equivalent to: + * {@snippet lang=java : + * int size = Objects.requireNonNull(elements).length; + * MemorySegment seg = allocateArray(Objects.requireNonNull(elementLayout), size); + * MemorySegment.copy(elements, 0, seg, elementLayout, 0, size); + * return seg; + * } + * * @param elementLayout the element layout of the array to be allocated. - * @param elements the double elements to be copied to the newly allocated memory block. - * @return a segment for the newly allocated memory block. + * @param elements the short elements to be copied to the newly allocated memory block. */ default MemorySegment allocateArray(ValueLayout.OfDouble elementLayout, double... elements) { return copyArrayWithSwapIfNeeded(elements, elementLayout, MemorySegment::ofArray); @@ -301,19 +420,21 @@ default MemorySegment allocateArray(ValueLayout.OfDouble elementLayout, double.. private MemorySegment copyArrayWithSwapIfNeeded(Z array, ValueLayout elementLayout, Function heapSegmentFactory) { int size = Array.getLength(Objects.requireNonNull(array)); - MemorySegment addr = allocateArray(Objects.requireNonNull(elementLayout), size); + MemorySegment seg = allocateArray(Objects.requireNonNull(elementLayout), size); if (size > 0) { MemorySegment.copy(heapSegmentFactory.apply(array), elementLayout, 0, - addr, elementLayout.withOrder(ByteOrder.nativeOrder()), 0, size); + seg, elementLayout.withOrder(ByteOrder.nativeOrder()), 0, size); } - return addr; + return seg; } /** - * Allocates a memory segment with the given layout. - * @implSpec the default implementation for this method calls {@code this.allocate(layout.byteSize(), layout.byteAlignment())}. + * {@return a new memory segment with the given layout} + * + * @implSpec The default implementation for this method calls + * {@code this.allocate(layout.byteSize(), layout.byteAlignment())}. + * * @param layout the layout of the block of memory to be allocated. - * @return a segment for the newly allocated memory block. */ default MemorySegment allocate(MemoryLayout layout) { Objects.requireNonNull(layout); @@ -321,11 +442,13 @@ default MemorySegment allocate(MemoryLayout layout) { } /** - * Allocates a memory segment with the given element layout and size. - * @implSpec the default implementation for this method calls {@code this.allocate(MemoryLayout.sequenceLayout(count, elementLayout))}. + * {@return a new memory segment with the given {@code elementLayout} and {@code count}} + * + * @implSpec The default implementation for this method calls + * {@code this.allocate(MemoryLayout.sequenceLayout(count, elementLayout))}. + * * @param elementLayout the array element layout. * @param count the array element count. - * @return a segment for the newly allocated memory block. * @throws IllegalArgumentException if {@code elementLayout.byteSize() * count} overflows. * @throws IllegalArgumentException if {@code count < 0}. */ @@ -338,10 +461,12 @@ default MemorySegment allocateArray(MemoryLayout elementLayout, long count) { } /** - * Allocates a memory segment with the given size. - * @implSpec the default implementation for this method calls {@code this.allocate(byteSize, 1)}. + * {@return a new memory segment with the given {@code byteSize}} + * + * @implSpec The default implementation for this method calls + * {@code this.allocate(byteSize, 1)}. + * * @param byteSize the size (in bytes) of the block of memory to be allocated. - * @return a segment for the newly allocated memory block. * @throws IllegalArgumentException if {@code byteSize < 0} */ default MemorySegment allocate(long byteSize) { @@ -349,10 +474,10 @@ default MemorySegment allocate(long byteSize) { } /** - * Allocates a memory segment with the given size and alignment constraint. + * {@return a new memory segment with the given {@code byteSize} and {@code byteAlignment}} + * * @param byteSize the size (in bytes) of the block of memory to be allocated. * @param byteAlignment the alignment (in bytes) of the block of memory to be allocated. - * @return a segment for the newly allocated memory block. * @throws IllegalArgumentException if {@code byteSize < 0}, {@code byteAlignment <= 0}, * or if {@code byteAlignment} is not a power of 2. */ @@ -365,6 +490,7 @@ default MemorySegment allocate(long byteSize) { *

* The returned allocator throws {@link IndexOutOfBoundsException} when a slice of the provided * segment with the requested size and alignment cannot be found. + * * @implNote A slicing allocator is not thread-safe. * * @param segment the segment which the returned allocator should slice from. From 83adaf5477d1aa0128079a60be8847319dbadccc Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Thu, 10 Aug 2023 08:17:03 +0000 Subject: [PATCH 005/162] 8313421: [JVMCI] avoid locking class loader in CompilerToVM.lookupType Reviewed-by: never, thartmann --- src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 15 ++++-- src/hotspot/share/jvmci/jvmciEnv.cpp | 2 +- src/hotspot/share/jvmci/jvmciEnv.hpp | 2 +- src/hotspot/share/jvmci/jvmciJavaClasses.hpp | 8 ++-- .../jdk/vm/ci/hotspot/CompilerToVM.java | 46 ++++++++++++++++--- .../vm/ci/hotspot/HotSpotJVMCIRuntime.java | 20 +++----- .../HotSpotMethodHandleAccessProvider.java | 21 +++++---- .../hotspot/SharedLibraryJVMCIReflection.java | 12 +---- 8 files changed, 74 insertions(+), 52 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index 6d4a1c288c0..a6efcd3aff8 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -576,7 +576,7 @@ C2V_VMENTRY_0(jboolean, shouldInlineMethod,(JNIEnv* env, jobject, ARGUMENT_PAIR( return CompilerOracle::should_inline(method) || method->force_inline(); C2V_END -C2V_VMENTRY_NULL(jobject, lookupType, (JNIEnv* env, jobject, jstring jname, ARGUMENT_PAIR(accessing_klass), jboolean resolve)) +C2V_VMENTRY_NULL(jobject, lookupType, (JNIEnv* env, jobject, jstring jname, ARGUMENT_PAIR(accessing_klass), jint accessing_klass_loader, jboolean resolve)) JVMCIObject name = JVMCIENV->wrap(jname); const char* str = JVMCIENV->as_utf8_string(name); TempNewSymbol class_name = SymbolTable::new_symbol(str); @@ -593,15 +593,20 @@ C2V_VMENTRY_NULL(jobject, lookupType, (JNIEnv* env, jobject, jstring jname, ARGU class_loader = Handle(THREAD, accessing_klass->class_loader()); protection_domain = Handle(THREAD, accessing_klass->protection_domain()); } else { - // Use the System class loader - class_loader = Handle(THREAD, SystemDictionary::java_system_loader()); + switch (accessing_klass_loader) { + case 0: break; // class_loader is already null, the boot loader + case 1: class_loader = Handle(THREAD, SystemDictionary::java_platform_loader()); break; + case 2: class_loader = Handle(THREAD, SystemDictionary::java_system_loader()); break; + default: + JVMCI_THROW_MSG_0(InternalError, err_msg("Illegal class loader value: %d", accessing_klass_loader)); + } JVMCIENV->runtime()->initialize(JVMCI_CHECK_NULL); } if (resolve) { resolved_klass = SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, CHECK_NULL); if (resolved_klass == nullptr) { - JVMCI_THROW_MSG_NULL(ClassNotFoundException, str); + JVMCI_THROW_MSG_NULL(NoClassDefFoundError, str); } } else { if (Signature::has_envelope(class_name)) { @@ -3108,7 +3113,7 @@ JNINativeMethod CompilerToVM::methods[] = { {CC "isCompilable", CC "(" HS_METHOD2 ")Z", FN_PTR(isCompilable)}, {CC "hasNeverInlineDirective", CC "(" HS_METHOD2 ")Z", FN_PTR(hasNeverInlineDirective)}, {CC "shouldInlineMethod", CC "(" HS_METHOD2 ")Z", FN_PTR(shouldInlineMethod)}, - {CC "lookupType", CC "(" STRING HS_KLASS2 "Z)" HS_RESOLVED_TYPE, FN_PTR(lookupType)}, + {CC "lookupType", CC "(" STRING HS_KLASS2 "IZ)" HS_RESOLVED_TYPE, FN_PTR(lookupType)}, {CC "lookupJClass", CC "(J)" HS_RESOLVED_TYPE, FN_PTR(lookupJClass)}, {CC "getArrayType", CC "(C" HS_KLASS2 ")" HS_KLASS, FN_PTR(getArrayType)}, {CC "lookupClass", CC "(" CLASS ")" HS_RESOLVED_TYPE, FN_PTR(lookupClass)}, diff --git a/src/hotspot/share/jvmci/jvmciEnv.cpp b/src/hotspot/share/jvmci/jvmciEnv.cpp index 40aadfe1670..217725f256d 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.cpp +++ b/src/hotspot/share/jvmci/jvmciEnv.cpp @@ -864,7 +864,7 @@ DO_THROW(InvalidInstalledCodeException) DO_THROW(UnsatisfiedLinkError) DO_THROW(UnsupportedOperationException) DO_THROW(OutOfMemoryError) -DO_THROW(ClassNotFoundException) +DO_THROW(NoClassDefFoundError) #undef DO_THROW diff --git a/src/hotspot/share/jvmci/jvmciEnv.hpp b/src/hotspot/share/jvmci/jvmciEnv.hpp index ce5922eaf9c..ca76d6501f2 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.hpp +++ b/src/hotspot/share/jvmci/jvmciEnv.hpp @@ -358,7 +358,7 @@ class JVMCIEnv : public ResourceObj { DO_THROW(UnsatisfiedLinkError) DO_THROW(UnsupportedOperationException) DO_THROW(OutOfMemoryError) - DO_THROW(ClassNotFoundException) + DO_THROW(NoClassDefFoundError) #undef DO_THROW diff --git a/src/hotspot/share/jvmci/jvmciJavaClasses.hpp b/src/hotspot/share/jvmci/jvmciJavaClasses.hpp index 279e73fe880..9bd87009b11 100644 --- a/src/hotspot/share/jvmci/jvmciJavaClasses.hpp +++ b/src/hotspot/share/jvmci/jvmciJavaClasses.hpp @@ -243,11 +243,11 @@ start_class(InternalError, java_lang_InternalError) \ jvmci_constructor(InternalError, "(Ljava/lang/String;)V") \ end_class \ - start_class(OutOfMemoryError, java_lang_OutOfMemoryError) \ - jvmci_constructor(OutOfMemoryError, "(Ljava/lang/String;)V") \ + start_class(OutOfMemoryError, java_lang_OutOfMemoryError) \ + jvmci_constructor(OutOfMemoryError, "(Ljava/lang/String;)V") \ end_class \ - start_class(ClassNotFoundException, java_lang_ClassNotFoundException) \ - jvmci_constructor(ClassNotFoundException, "(Ljava/lang/String;)V") \ + start_class(NoClassDefFoundError, java_lang_NoClassDefFoundError) \ + jvmci_constructor(NoClassDefFoundError, "(Ljava/lang/String;)V") \ end_class \ start_class(InvalidInstalledCodeException, jdk_vm_ci_code_InvalidInstalledCodeException) \ jvmci_constructor(InvalidInstalledCodeException, "(Ljava/lang/String;)V") \ diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java index 777f0fe5c31..59f9cf1b129 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java @@ -240,20 +240,52 @@ boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethodImpl method) * Converts a name to a type. * * @param name a well formed Java type in {@linkplain JavaType#getName() internal} format - * @param accessingClass the context of resolution. A value of {@code null} implies that the - * class should be resolved with the {@linkplain ClassLoader#getSystemClassLoader() - * system class loader}. + * @param accessingClass the class loader of this class is used for resolution. Must not be null. * @param resolve force resolution to a {@link ResolvedJavaType}. If true, this method will * either return a {@link ResolvedJavaType} or throw an exception * @return the type for {@code name} or 0 if resolution failed and {@code resolve == false} - * @throws ClassNotFoundException if {@code resolve == true} and the resolution failed + * @throws NoClassDefFoundError if {@code resolve == true} and the resolution failed */ - HotSpotResolvedJavaType lookupType(String name, HotSpotResolvedObjectTypeImpl accessingClass, boolean resolve) throws ClassNotFoundException { - return lookupType(name, accessingClass, accessingClass != null ? accessingClass.getKlassPointer() : 0L, resolve); + HotSpotResolvedJavaType lookupType(String name, HotSpotResolvedObjectTypeImpl accessingClass, boolean resolve) throws NoClassDefFoundError { + return lookupType(name, accessingClass, accessingClass.getKlassPointer(), -1, resolve); } - private native HotSpotResolvedJavaType lookupType(String name, HotSpotResolvedObjectTypeImpl accessingClass, long klassPointer, boolean resolve) throws ClassNotFoundException; + /** + * Converts a name to a type. + * + * @param classLoader the class loader to use for resolution. Must not be {@code null}, + * {@link ClassLoader#getPlatformClassLoader} or {@link ClassLoader#getSystemClassLoader} + * @param name a well formed Java type in {@linkplain JavaType#getName() internal} format + * @return the type for {@code name} + * @throws NoClassDefFoundError if resolution failed + */ + HotSpotResolvedJavaType lookupType(ClassLoader classLoader, String name) throws NoClassDefFoundError { + int accessingClassLoader; + if (classLoader == null) { + accessingClassLoader = 0; + } else if (classLoader == ClassLoader.getPlatformClassLoader()) { + accessingClassLoader = 1; + } else if (classLoader == ClassLoader.getSystemClassLoader()) { + accessingClassLoader = 2; + } else { + throw new IllegalArgumentException("Unsupported class loader for lookup: " + classLoader); + } + return lookupType(name, null, 0L, accessingClassLoader, true); + } + /** + * @param accessingClassLoader ignored if {@code accessingKlassPointer != 0L}. Otherwise, the supported values are: + * 0 - boot class loader + * 1 - {@linkplain ClassLoader#getPlatformClassLoader() platform class loader} + * 2 - {@linkplain ClassLoader#getSystemClassLoader() system class loader} + */ + private native HotSpotResolvedJavaType lookupType(String name, HotSpotResolvedObjectTypeImpl accessingClass, long accessingKlassPointer, int accessingClassLoader, boolean resolve) throws NoClassDefFoundError; + + /** + * Converts {@code javaClass} to a HotSpotResolvedJavaType. + * + * Must not be called if {@link Services#IS_IN_NATIVE_IMAGE} is {@code true}. + */ native HotSpotResolvedJavaType lookupClass(Class javaClass); native HotSpotResolvedJavaType lookupJClass(long jclass); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index fe736afbba8..02ed11cae2a 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -627,11 +627,7 @@ HotSpotResolvedJavaType createClass(Class javaClass) { return HotSpotResolvedPrimitiveType.forKind(JavaKind.fromJavaClass(javaClass)); } if (IS_IN_NATIVE_IMAGE) { - try { - return compilerToVm.lookupType(javaClass.getName().replace('.', '/'), null, true); - } catch (ClassNotFoundException e) { - throw new JVMCIError(e); - } + return compilerToVm.lookupType(javaClass.getClassLoader(), javaClass.getName().replace('.', '/')); } return compilerToVm.lookupClass(javaClass); } @@ -869,17 +865,13 @@ JavaType lookupTypeInternal(String name, HotSpotResolvedObjectType accessingType // Resolve non-primitive types in the VM. HotSpotResolvedObjectTypeImpl hsAccessingType = (HotSpotResolvedObjectTypeImpl) accessingType; - try { - final HotSpotResolvedJavaType klass = compilerToVm.lookupType(name, hsAccessingType, resolve); + final HotSpotResolvedJavaType klass = compilerToVm.lookupType(name, hsAccessingType, resolve); - if (klass == null) { - assert resolve == false : name; - return UnresolvedJavaType.create(name); - } - return klass; - } catch (ClassNotFoundException e) { - throw (NoClassDefFoundError) new NoClassDefFoundError().initCause(e); + if (klass == null) { + assert resolve == false : name; + return UnresolvedJavaType.create(name); } + return klass; } /** diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java index d7e203d98a8..7e47196a42b 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java @@ -77,26 +77,27 @@ private static ResolvedJavaField findFieldInClass(ResolvedJavaType declaringType throw new NoSuchFieldError(declaringType + "." + fieldName); } - private static ResolvedJavaType resolveType(String className) { - return (ResolvedJavaType) runtime().lookupTypeInternal(className, null, true); + private static ResolvedJavaType resolveType(String className, HotSpotResolvedObjectType accessingType) { + return (ResolvedJavaType) runtime().lookupTypeInternal(className, accessingType, true); } private Internals() { try { - ResolvedJavaType methodHandleType = resolveType("Ljava/lang/invoke/MethodHandle;"); - ResolvedJavaType memberNameType = resolveType("Ljava/lang/invoke/MemberName;"); - lambdaFormType = resolveType("Ljava/lang/invoke/LambdaForm;"); + HotSpotResolvedObjectType accessingType = runtime().getJavaLangObject(); + ResolvedJavaType methodHandleType = resolveType("Ljava/lang/invoke/MethodHandle;", accessingType); + ResolvedJavaType memberNameType = resolveType("Ljava/lang/invoke/MemberName;", accessingType); + lambdaFormType = resolveType("Ljava/lang/invoke/LambdaForm;", accessingType); methodHandleFormField = findFieldInClass(methodHandleType, "form", lambdaFormType); lambdaFormVmentryField = findFieldInClass(lambdaFormType, "vmentry", memberNameType); - ResolvedJavaType methodType = resolveType("Ljava/lang/invoke/ResolvedMethodName;"); + ResolvedJavaType methodType = resolveType("Ljava/lang/invoke/ResolvedMethodName;", accessingType); methodField = findFieldInClass(memberNameType, "method", methodType); - vmtargetField = (HotSpotResolvedJavaField) findFieldInClass(methodType, "vmtarget", resolveType(Character.toString(HotSpotJVMCIRuntime.getHostWordKind().getTypeChar()))); + vmtargetField = (HotSpotResolvedJavaField) findFieldInClass(methodType, "vmtarget", resolveType(Character.toString(HotSpotJVMCIRuntime.getHostWordKind().getTypeChar()), accessingType)); - ResolvedJavaType callSiteType = resolveType("Ljava/lang/invoke/CallSite;"); + ResolvedJavaType callSiteType = resolveType("Ljava/lang/invoke/CallSite;", accessingType); callSiteTargetField = (HotSpotResolvedJavaField) findFieldInClass(callSiteType, "target", methodHandleType); - ResolvedJavaType constantCallSiteType = resolveType("Ljava/lang/invoke/ConstantCallSite;"); - ResolvedJavaType booleanType = resolveType("Z"); + ResolvedJavaType constantCallSiteType = resolveType("Ljava/lang/invoke/ConstantCallSite;", accessingType); + ResolvedJavaType booleanType = resolveType("Z", accessingType); constantCallSiteFrozenField = (HotSpotResolvedJavaField) findFieldInClass(constantCallSiteType, "isFrozen", booleanType); } catch (Throwable ex) { throw new JVMCIError(ex); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/SharedLibraryJVMCIReflection.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/SharedLibraryJVMCIReflection.java index 6cf93c32394..2877a09968f 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/SharedLibraryJVMCIReflection.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/SharedLibraryJVMCIReflection.java @@ -188,16 +188,8 @@ T getFieldAnnotation(HotSpotResolvedJavaFieldImpl javaFie HotSpotResolvedObjectTypeImpl getType(HotSpotObjectConstantImpl object) { if (object instanceof DirectHotSpotObjectConstantImpl) { Class theClass = ((DirectHotSpotObjectConstantImpl) object).object.getClass(); - try { - String name = theClass.getName().replace('.', '/'); - HotSpotResolvedObjectTypeImpl type = (HotSpotResolvedObjectTypeImpl) runtime().compilerToVm.lookupType(name, null, true); - if (type == null) { - throw new InternalError(name); - } - return type; - } catch (ClassNotFoundException e) { - throw new InternalError(e); - } + String name = theClass.getName().replace('.', '/'); + return (HotSpotResolvedObjectTypeImpl) runtime().compilerToVm.lookupType(theClass.getClassLoader(), name); } return runtime().compilerToVm.getResolvedJavaType(object, runtime().getConfig().hubOffset, false); } From 028b3ae1b162bd8f7c340bfa6e9487ca83697955 Mon Sep 17 00:00:00 2001 From: Oli Gillespie Date: Thu, 10 Aug 2023 08:51:50 +0000 Subject: [PATCH 006/162] 8313874: JNI NewWeakGlobalRef throws exception for null arg Reviewed-by: dholmes, kbarrett, shade --- src/hotspot/share/prims/jni.cpp | 2 +- .../jtreg/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/prims/jni.cpp b/src/hotspot/share/prims/jni.cpp index 7377a22ed3d..2d73feba613 100644 --- a/src/hotspot/share/prims/jni.cpp +++ b/src/hotspot/share/prims/jni.cpp @@ -2875,7 +2875,7 @@ JNI_ENTRY(jweak, jni_NewWeakGlobalRef(JNIEnv *env, jobject ref)) HOTSPOT_JNI_NEWWEAKGLOBALREF_ENTRY(env, ref); Handle ref_handle(thread, JNIHandles::resolve(ref)); jweak ret = JNIHandles::make_weak_global(ref_handle, AllocFailStrategy::RETURN_NULL); - if (ret == nullptr) { + if (ret == nullptr && ref_handle.not_null()) { THROW_OOP_(Universe::out_of_memory_error_c_heap(), nullptr); } HOTSPOT_JNI_NEWWEAKGLOBALREF_RETURN(ret); diff --git a/test/hotspot/jtreg/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java b/test/hotspot/jtreg/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java index 27530249577..e41a2a087e1 100644 --- a/test/hotspot/jtreg/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java +++ b/test/hotspot/jtreg/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java @@ -123,9 +123,19 @@ private static void testClear() throws Exception { } } + // Verify passing a null value returns null and doesn't throw. + private static void testNullValue() { + System.out.println("running testNullValue"); + registerObject(null); + if (getObject() != null) { + throw new RuntimeException("expected null"); + } + } + public static void main(String[] args) throws Exception { testSanity(); testSurvival(); testClear(); + testNullValue(); } } From 0cb9ab04f4c408bce7c4bc0e028fa9d4959abd79 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Thu, 10 Aug 2023 10:01:46 +0000 Subject: [PATCH 007/162] 8313239: InetAddress.getCanonicalHostName may return ip address if reverse lookup fails Reviewed-by: dfuchs, aefimov, alanb --- .../share/classes/java/net/InetAddress.java | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/java.base/share/classes/java/net/InetAddress.java b/src/java.base/share/classes/java/net/InetAddress.java index fcc2e270026..5062671a1ab 100644 --- a/src/java.base/share/classes/java/net/InetAddress.java +++ b/src/java.base/share/classes/java/net/InetAddress.java @@ -731,8 +731,8 @@ public boolean isReachable(NetworkInterface netif, int ttl, *

If this InetAddress was created with a host name, * this host name will be remembered and returned; * otherwise, a reverse name lookup will be performed - * and the result will be returned based on the system - * configured resolver. If a lookup of the name service + * and the result will be returned based on the system-wide + * resolver. If a lookup of the name service * is required, call * {@link #getCanonicalHostName() getCanonicalHostName}. * @@ -785,9 +785,15 @@ String getHostName(boolean check) { } /** - * Gets the fully qualified domain name for this IP address. - * Best effort method, meaning we may not be able to return - * the FQDN depending on the underlying system configuration. + * Gets the fully qualified domain name for this + * {@linkplain InetAddress#getAddress() IP address} using the system-wide + * {@linkplain InetAddressResolver resolver}. + * + *

The system-wide resolver will be used to do a reverse name lookup of the IP address. + * The lookup can fail for many reasons that include the host not being registered with the name + * service. If the resolver is unable to determine the fully qualified + * domain name, this method returns the {@linkplain #getHostAddress() textual representation} + * of the IP address. * *

If there is a security manager, this method first * calls its {@code checkConnect} method @@ -797,9 +803,11 @@ String getHostName(boolean check) { * If the operation is not allowed, it will return * the textual representation of the IP address. * - * @return the fully qualified domain name for this IP address, - * or if the operation is not allowed by the security check, - * the textual representation of the IP address. + * @return the fully qualified domain name for this IP address. + * If either the operation is not allowed by the security check + * or the system-wide resolver wasn't able to determine the + * fully qualified domain name for the IP address, the textual + * representation of the IP address is returned instead. * * @see SecurityManager#checkConnect * @@ -814,22 +822,24 @@ public String getCanonicalHostName() { } /** - * Returns the hostname for this address. + * Returns the fully qualified domain name for the given address. * *

If there is a security manager, this method first * calls its {@code checkConnect} method * with the hostname and {@code -1} * as its arguments to see if the calling code is allowed to know - * the hostname for this IP address, i.e., to connect to the host. + * the hostname for the given IP address, i.e., to connect to the host. * If the operation is not allowed, it will return * the textual representation of the IP address. * - * @return the host name for this IP address, or if the operation - * is not allowed by the security check, the textual - * representation of the IP address. - * * @param check make security check if true * + * @return the fully qualified domain name for the given IP address. + * If either the operation is not allowed by the security check + * or the system-wide resolver wasn't able to determine the + * fully qualified domain name for the IP address, the textual + * representation of the IP address is returned instead. + * * @see SecurityManager#checkConnect */ private static String getHostFromNameService(InetAddress addr, boolean check) { @@ -1570,7 +1580,7 @@ public static InetAddress getByName(String host) /** * Given the name of a host, returns an array of its IP addresses, - * based on the configured system {@linkplain InetAddressResolver resolver}. + * based on the system-wide {@linkplain InetAddressResolver resolver}. * *

The host name can either be a machine name, such as * "{@code www.example.com}", or a textual representation of its IP From f47767ffef29c777e2da0262fa3299564d59f461 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 10 Aug 2023 11:57:25 +0000 Subject: [PATCH 008/162] 8313882: Fix -Wconversion warnings in runtime code Reviewed-by: pchilanomate, dlong, dholmes --- src/hotspot/share/interpreter/bytecode.hpp | 10 +++--- src/hotspot/share/jvmci/vmStructs_jvmci.cpp | 2 +- src/hotspot/share/runtime/arguments.cpp | 32 +++++++++---------- src/hotspot/share/runtime/arguments.hpp | 8 ++--- .../share/runtime/continuationFreezeThaw.cpp | 12 +++---- src/hotspot/share/runtime/deoptimization.cpp | 10 +++--- src/hotspot/share/runtime/globals.hpp | 4 +-- src/hotspot/share/runtime/java.cpp | 17 +++++----- src/hotspot/share/runtime/java.hpp | 26 +++++++-------- src/hotspot/share/runtime/javaThread.cpp | 20 ++++++------ src/hotspot/share/runtime/javaThread.hpp | 18 ++++------- src/hotspot/share/runtime/objectMonitor.hpp | 2 +- src/hotspot/share/runtime/os.cpp | 6 ++-- src/hotspot/share/runtime/relocator.cpp | 25 ++++++++------- src/hotspot/share/runtime/safepoint.cpp | 2 +- src/hotspot/share/runtime/sharedRuntime.cpp | 14 ++++---- src/hotspot/share/runtime/signature.cpp | 4 +-- src/hotspot/share/runtime/synchronizer.cpp | 6 ++-- src/hotspot/share/runtime/thread.cpp | 4 +-- .../share/runtime/threadHeapSampler.cpp | 4 +-- src/hotspot/share/runtime/timer.cpp | 4 +-- src/hotspot/share/runtime/trimNativeHeap.cpp | 4 +-- src/hotspot/share/runtime/vmStructs.cpp | 6 +--- src/hotspot/share/services/attachListener.cpp | 14 ++++---- test/hotspot/gtest/runtime/test_os.cpp | 6 ++-- .../gtest/runtime/test_stubRoutines.cpp | 4 +-- 26 files changed, 129 insertions(+), 135 deletions(-) diff --git a/src/hotspot/share/interpreter/bytecode.hpp b/src/hotspot/share/interpreter/bytecode.hpp index b8d9b80d835..0effa979073 100644 --- a/src/hotspot/share/interpreter/bytecode.hpp +++ b/src/hotspot/share/interpreter/bytecode.hpp @@ -274,7 +274,7 @@ class Bytecode_checkcast: public Bytecode { void verify() const { assert(Bytecodes::java_code(code()) == Bytecodes::_checkcast, "check checkcast"); } // Returns index - long index() const { return get_index_u2(Bytecodes::_checkcast); }; + u2 index() const { return get_index_u2(Bytecodes::_checkcast); }; }; // Abstraction for instanceof @@ -284,7 +284,7 @@ class Bytecode_instanceof: public Bytecode { void verify() const { assert(code() == Bytecodes::_instanceof, "check instanceof"); } // Returns index - long index() const { return get_index_u2(Bytecodes::_instanceof); }; + u2 index() const { return get_index_u2(Bytecodes::_instanceof); }; }; class Bytecode_new: public Bytecode { @@ -293,7 +293,7 @@ class Bytecode_new: public Bytecode { void verify() const { assert(java_code() == Bytecodes::_new, "check new"); } // Returns index - long index() const { return get_index_u2(Bytecodes::_new); }; + u2 index() const { return get_index_u2(Bytecodes::_new); }; }; class Bytecode_multianewarray: public Bytecode { @@ -302,7 +302,7 @@ class Bytecode_multianewarray: public Bytecode { void verify() const { assert(java_code() == Bytecodes::_multianewarray, "check new"); } // Returns index - long index() const { return get_index_u2(Bytecodes::_multianewarray); }; + u2 index() const { return get_index_u2(Bytecodes::_multianewarray); }; }; class Bytecode_anewarray: public Bytecode { @@ -311,7 +311,7 @@ class Bytecode_anewarray: public Bytecode { void verify() const { assert(java_code() == Bytecodes::_anewarray, "check anewarray"); } // Returns index - long index() const { return get_index_u2(Bytecodes::_anewarray); }; + u2 index() const { return get_index_u2(Bytecodes::_anewarray); }; }; // Abstraction for ldc, ldc_w and ldc2_w diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index 312eee25b5a..6953f5f5409 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -215,7 +215,7 @@ nonstatic_field(JavaThread, _jni_environment, JNIEnv) \ nonstatic_field(JavaThread, _poll_data, SafepointMechanism::ThreadData) \ nonstatic_field(JavaThread, _stack_overflow_state._reserved_stack_activation, address) \ - nonstatic_field(JavaThread, _held_monitor_count, int64_t) \ + nonstatic_field(JavaThread, _held_monitor_count, intx) \ JVMTI_ONLY(nonstatic_field(JavaThread, _is_in_VTMS_transition, bool)) \ JVMTI_ONLY(nonstatic_field(JavaThread, _is_in_tmp_VTMS_transition, bool)) \ \ diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 4d7975b3a5b..cc735ad5ac8 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -1177,7 +1177,7 @@ bool Arguments::process_settings_file(const char* file_name, bool should_exist, bool in_white_space = true; bool in_comment = false; bool in_quote = false; - char quote_c = 0; + int quote_c = 0; bool result = true; int c = getc(stream); @@ -1189,7 +1189,7 @@ bool Arguments::process_settings_file(const char* file_name, bool should_exist, if (c == '#') in_comment = true; else if (!isspace(c)) { in_white_space = false; - token[pos++] = c; + token[pos++] = checked_cast(c); } } } else { @@ -1209,7 +1209,7 @@ bool Arguments::process_settings_file(const char* file_name, bool should_exist, } else if (in_quote && (c == quote_c)) { in_quote = false; } else { - token[pos++] = c; + token[pos++] = checked_cast(c); } } c = getc(stream); @@ -1565,22 +1565,22 @@ void Arguments::set_heap_size() { // Convert deprecated flags if (FLAG_IS_DEFAULT(MaxRAMPercentage) && !FLAG_IS_DEFAULT(MaxRAMFraction)) - MaxRAMPercentage = 100.0 / MaxRAMFraction; + MaxRAMPercentage = 100.0 / (double)MaxRAMFraction; if (FLAG_IS_DEFAULT(MinRAMPercentage) && !FLAG_IS_DEFAULT(MinRAMFraction)) - MinRAMPercentage = 100.0 / MinRAMFraction; + MinRAMPercentage = 100.0 / (double)MinRAMFraction; if (FLAG_IS_DEFAULT(InitialRAMPercentage) && !FLAG_IS_DEFAULT(InitialRAMFraction)) - InitialRAMPercentage = 100.0 / InitialRAMFraction; + InitialRAMPercentage = 100.0 / (double)InitialRAMFraction; // If the maximum heap size has not been set with -Xmx, // then set it as fraction of the size of physical memory, // respecting the maximum and minimum sizes of the heap. if (FLAG_IS_DEFAULT(MaxHeapSize)) { - julong reasonable_max = (julong)((phys_mem * MaxRAMPercentage) / 100); - const julong reasonable_min = (julong)((phys_mem * MinRAMPercentage) / 100); + julong reasonable_max = (julong)(((double)phys_mem * MaxRAMPercentage) / 100); + const julong reasonable_min = (julong)(((double)phys_mem * MinRAMPercentage) / 100); if (reasonable_min < MaxHeapSize) { // Small physical memory, so use a minimum fraction of it for the heap reasonable_max = reasonable_min; @@ -1664,7 +1664,7 @@ void Arguments::set_heap_size() { reasonable_minimum = limit_heap_by_allocatable_memory(reasonable_minimum); if (InitialHeapSize == 0) { - julong reasonable_initial = (julong)((phys_mem * InitialRAMPercentage) / 100); + julong reasonable_initial = (julong)(((double)phys_mem * InitialRAMPercentage) / 100); reasonable_initial = limit_heap_by_allocatable_memory(reasonable_initial); reasonable_initial = MAX3(reasonable_initial, reasonable_minimum, (julong)MinHeapSize); @@ -1965,15 +1965,15 @@ static const char* system_assertion_options[] = { "-dsa", "-esa", "-disablesystemassertions", "-enablesystemassertions", 0 }; -bool Arguments::parse_uintx(const char* value, - uintx* uintx_arg, - uintx min_size) { - uintx n; +bool Arguments::parse_uint(const char* value, + uint* uint_arg, + uint min_size) { + uint n; if (!parse_integer(value, &n)) { return false; } if (n >= min_size) { - *uintx_arg = n; + *uint_arg = n; return true; } else { return false; @@ -2728,8 +2728,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m return JNI_EINVAL; } } else if (match_option(option, "-XX:MaxTenuringThreshold=", &tail)) { - uintx max_tenuring_thresh = 0; - if (!parse_uintx(tail, &max_tenuring_thresh, 0)) { + uint max_tenuring_thresh = 0; + if (!parse_uint(tail, &max_tenuring_thresh, 0)) { jio_fprintf(defaultStream::error_stream(), "Improperly specified VM option \'MaxTenuringThreshold=%s\'\n", tail); return JNI_EINVAL; diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp index dcc5e9e4e70..f7b513d4e12 100644 --- a/src/hotspot/share/runtime/arguments.hpp +++ b/src/hotspot/share/runtime/arguments.hpp @@ -378,10 +378,10 @@ class Arguments : AllStatic { static jint parse(const JavaVMInitArgs* args); // Parse a string for a unsigned integer. Returns true if value // is an unsigned integer greater than or equal to the minimum - // parameter passed and returns the value in uintx_arg. Returns - // false otherwise, with uintx_arg undefined. - static bool parse_uintx(const char* value, uintx* uintx_arg, - uintx min_size); + // parameter passed and returns the value in uint_arg. Returns + // false otherwise, with uint_arg undefined. + static bool parse_uint(const char* value, uint* uintx_arg, + uint min_size); // Apply ergonomics static jint apply_ergo(); // Adjusts the arguments after the OS have adjusted the arguments diff --git a/src/hotspot/share/runtime/continuationFreezeThaw.cpp b/src/hotspot/share/runtime/continuationFreezeThaw.cpp index 36ce7a532eb..76412ca3dc2 100644 --- a/src/hotspot/share/runtime/continuationFreezeThaw.cpp +++ b/src/hotspot/share/runtime/continuationFreezeThaw.cpp @@ -404,7 +404,7 @@ class FreezeBase : public StackObj { // slow path virtual stackChunkOop allocate_chunk_slow(size_t stack_size) = 0; - int cont_size() { return _cont_stack_bottom - _cont_stack_top; } + int cont_size() { return pointer_delta_as_int(_cont_stack_bottom, _cont_stack_top); } private: // slow path @@ -1064,7 +1064,7 @@ NOINLINE freeze_result FreezeBase::recurse_freeze_interpreted_frame(frame& f, fr // The frame's top never includes the stack arguments to the callee intptr_t* const stack_frame_top = ContinuationHelper::InterpretedFrame::frame_top(f, callee_argsize, callee_interpreted); intptr_t* const stack_frame_bottom = ContinuationHelper::InterpretedFrame::frame_bottom(f); - const int fsize = stack_frame_bottom - stack_frame_top; + const int fsize = pointer_delta_as_int(stack_frame_bottom, stack_frame_top); DEBUG_ONLY(verify_frame_top(f, stack_frame_top)); @@ -1123,7 +1123,7 @@ freeze_result FreezeBase::recurse_freeze_compiled_frame(frame& f, frame& caller, intptr_t* const stack_frame_bottom = ContinuationHelper::CompiledFrame::frame_bottom(f); // including metadata between f and its stackargs const int argsize = ContinuationHelper::CompiledFrame::stack_argsize(f) + frame::metadata_words_at_top; - const int fsize = stack_frame_bottom + argsize - stack_frame_top; + const int fsize = pointer_delta_as_int(stack_frame_bottom + argsize, stack_frame_top); log_develop_trace(continuations)("recurse_freeze_compiled_frame %s _size: %d fsize: %d argsize: %d", ContinuationHelper::Frame::frame_method(f) != nullptr ? @@ -1627,7 +1627,7 @@ static freeze_result is_pinned0(JavaThread* thread, oop cont_scope, bool safepoi if (scope == cont_scope) { break; } - int monitor_count = entry->parent_held_monitor_count(); + intx monitor_count = entry->parent_held_monitor_count(); entry = entry->parent(); if (entry == nullptr) { break; @@ -2068,7 +2068,7 @@ void ThawBase::finalize_thaw(frame& entry, int argsize) { } assert(_stream.is_done() == chunk->is_empty(), ""); - int total_thawed = _stream.unextended_sp() - _top_unextended_sp_before_thaw; + int total_thawed = pointer_delta_as_int(_stream.unextended_sp(), _top_unextended_sp_before_thaw); chunk->set_max_thawing_size(chunk->max_thawing_size() - total_thawed); _cont.set_argsize(argsize); @@ -2154,7 +2154,7 @@ NOINLINE void ThawBase::recurse_thaw_interpreted_frame(const frame& hf, frame& c assert(hf.is_heap_frame(), "should be"); assert(!f.is_heap_frame(), "should not be"); - const int fsize = heap_frame_bottom - heap_frame_top; + const int fsize = pointer_delta_as_int(heap_frame_bottom, heap_frame_top); assert((stack_frame_bottom == stack_frame_top + fsize), ""); // Some architectures (like AArch64/PPC64/RISC-V) add padding between the locals and the fixed_frame to keep the fp 16-byte-aligned. diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index f6ea27f0a7a..c825b955b1f 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -248,11 +248,11 @@ Deoptimization::UnrollBlock::~UnrollBlock() { int Deoptimization::UnrollBlock::size_of_frames() const { // Account first for the adjustment of the initial frame - int result = _caller_adjustment; + intptr_t result = _caller_adjustment; for (int index = 0; index < number_of_frames(); index++) { result += frame_sizes()[index]; } - return result; + return checked_cast(result); } void Deoptimization::UnrollBlock::print() { @@ -1081,7 +1081,7 @@ template class Box objArrayOop cache = CacheType::cache(ik); assert(cache->length() > 0, "Empty cache"); _low = BoxType::value(cache->obj_at(0)); - _high = _low + cache->length() - 1; + _high = checked_cast(_low + cache->length() - 1); _cache = JNIHandles::make_global(Handle(thread, cache)); } } @@ -1100,7 +1100,7 @@ template class Box } oop lookup(PrimitiveType value) { if (_low <= value && value <= _high) { - int offset = value - _low; + int offset = checked_cast(value - _low); return objArrayOop(JNIHandles::resolve_non_null(_cache))->obj_at(offset); } return nullptr; @@ -1654,7 +1654,7 @@ vframeArray* Deoptimization::create_vframeArray(JavaThread* thread, frame fr, Re // stuff a C2I adapter we can properly fill in the callee-save // register locations. frame caller = fr.sender(reg_map); - int frame_size = caller.sp() - fr.sp(); + int frame_size = pointer_delta_as_int(caller.sp(), fr.sp()); frame sender = caller; diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 583eec7e3df..aeb332586b8 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -726,10 +726,10 @@ const int ObjectAlignmentInBytes = 8; /* because of overflow issue */ \ product(intx, MonitorDeflationMax, 1000000, DIAGNOSTIC, \ "The maximum number of monitors to deflate, unlink and delete " \ - "at one time (minimum is 1024).") \ + "at one time (minimum is 1024).") \ range(1024, max_jint) \ \ - product(intx, MonitorUsedDeflationThreshold, 90, DIAGNOSTIC, \ + product(int, MonitorUsedDeflationThreshold, 90, DIAGNOSTIC, \ "Percentage of used monitors before triggering deflation (0 is " \ "off). The check is performed on GuaranteedSafepointInterval, " \ "AsyncDeflationInterval or GuaranteedAsyncDeflationInterval, " \ diff --git a/src/hotspot/share/runtime/java.cpp b/src/hotspot/share/runtime/java.cpp index 48709aa5c43..10e0bfc837d 100644 --- a/src/hotspot/share/runtime/java.cpp +++ b/src/hotspot/share/runtime/java.cpp @@ -204,16 +204,17 @@ void print_method_invocation_histogram() { total = int_total + comp_total; special_total = final_total + static_total +synch_total + native_total + access_total; tty->print_cr("Invocations summary for %d methods:", collected_invoked_methods->length()); + double total_div = (double)total; tty->print_cr("\t" UINT64_FORMAT_W(12) " (100%%) total", total); - tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- interpreted", int_total, 100.0 * int_total / total); - tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- compiled", comp_total, 100.0 * comp_total / total); + tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- interpreted", int_total, 100.0 * (double)int_total / total_div); + tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- compiled", comp_total, 100.0 * (double)comp_total / total_div); tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- special methods (interpreted and compiled)", - special_total, 100.0 * special_total/ total); - tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- synchronized",synch_total, 100.0 * synch_total / total); - tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- final", final_total, 100.0 * final_total / total); - tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- static", static_total, 100.0 * static_total / total); - tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- native", native_total, 100.0 * native_total / total); - tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- accessor", access_total, 100.0 * access_total / total); + special_total, 100.0 * (double)special_total/ total_div); + tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- synchronized",synch_total, 100.0 * (double)synch_total / total_div); + tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- final", final_total, 100.0 * (double)final_total / total_div); + tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- static", static_total, 100.0 * (double)static_total / total_div); + tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- native", native_total, 100.0 * (double)native_total / total_div); + tty->print_cr("\t" UINT64_FORMAT_W(12) " (%4.1f%%) |- accessor", access_total, 100.0 * (double)access_total / total_div); tty->cr(); SharedRuntime::print_call_statistics(comp_total); } diff --git a/src/hotspot/share/runtime/java.hpp b/src/hotspot/share/runtime/java.hpp index 450be40fc82..9ab270e143d 100644 --- a/src/hotspot/share/runtime/java.hpp +++ b/src/hotspot/share/runtime/java.hpp @@ -77,11 +77,11 @@ class JDK_Version { static const char* _runtime_vendor_version; static const char* _runtime_vendor_vm_bug_url; - uint8_t _major; - uint8_t _minor; - uint8_t _security; - uint8_t _patch; - uint8_t _build; + int _major; + int _minor; + int _security; + int _patch; + int _build; bool is_valid() const { return (_major != 0); @@ -96,8 +96,8 @@ class JDK_Version { _major(0), _minor(0), _security(0), _patch(0), _build(0) {} - JDK_Version(uint8_t major, uint8_t minor = 0, uint8_t security = 0, - uint8_t patch = 0, uint8_t build = 0) : + JDK_Version(int major, int minor = 0, int security = 0, + int patch = 0, int build = 0) : _major(major), _minor(minor), _security(security), _patch(patch), _build(build) {} @@ -105,7 +105,7 @@ class JDK_Version { static JDK_Version current() { return _current; } // Factory methods for convenience - static JDK_Version jdk(uint8_t m) { + static JDK_Version jdk(int m) { return JDK_Version(m); } @@ -117,11 +117,11 @@ class JDK_Version { return _major == 0; } - uint8_t major_version() const { return _major; } - uint8_t minor_version() const { return _minor; } - uint8_t security_version() const { return _security; } - uint8_t patch_version() const { return _patch; } - uint8_t build_number() const { return _build; } + int major_version() const { return _major; } + int minor_version() const { return _minor; } + int security_version() const { return _security; } + int patch_version() const { return _patch; } + int build_number() const { return _build; } // Performs a full ordering comparison using all fields (patch, build, etc.) int compare(const JDK_Version& other) const; diff --git a/src/hotspot/share/runtime/javaThread.cpp b/src/hotspot/share/runtime/javaThread.cpp index 6814b2b6930..60672749203 100644 --- a/src/hotspot/share/runtime/javaThread.cpp +++ b/src/hotspot/share/runtime/javaThread.cpp @@ -875,10 +875,10 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) { // Since above code may not release JNI monitors and if someone forgot to do an // JNI monitorexit, held count should be equal jni count. // Consider scan all object monitor for this owner if JNI count > 0 (at least on detach). - assert(this->held_monitor_count() == this->jni_monitor_count(), - "held monitor count should be equal to jni: " INT64_FORMAT " != " INT64_FORMAT, - (int64_t)this->held_monitor_count(), (int64_t)this->jni_monitor_count()); - if (CheckJNICalls && this->jni_monitor_count() > 0) { + assert(held_monitor_count() == jni_monitor_count(), + "held monitor count should be equal to jni: " INTX_FORMAT " != " INTX_FORMAT, + held_monitor_count(), jni_monitor_count()); + if (CheckJNICalls && jni_monitor_count() > 0) { // We would like a fatal here, but due to we never checked this before there // is a lot of tests which breaks, even with an error log. log_debug(jni)("JavaThread %s (tid: " UINTX_FORMAT ") with Objects still locked by JNI MonitorEnter.", @@ -1940,24 +1940,24 @@ void JavaThread::trace_stack() { #endif // PRODUCT -void JavaThread::inc_held_monitor_count(int i, bool jni) { +void JavaThread::inc_held_monitor_count(intx i, bool jni) { #ifdef SUPPORT_MONITOR_COUNT - assert(_held_monitor_count >= 0, "Must always be greater than 0: " INT64_FORMAT, (int64_t)_held_monitor_count); + assert(_held_monitor_count >= 0, "Must always be greater than 0: " INTX_FORMAT, _held_monitor_count); _held_monitor_count += i; if (jni) { - assert(_jni_monitor_count >= 0, "Must always be greater than 0: " INT64_FORMAT, (int64_t)_jni_monitor_count); + assert(_jni_monitor_count >= 0, "Must always be greater than 0: " INTX_FORMAT, _jni_monitor_count); _jni_monitor_count += i; } #endif } -void JavaThread::dec_held_monitor_count(int i, bool jni) { +void JavaThread::dec_held_monitor_count(intx i, bool jni) { #ifdef SUPPORT_MONITOR_COUNT _held_monitor_count -= i; - assert(_held_monitor_count >= 0, "Must always be greater than 0: " INT64_FORMAT, (int64_t)_held_monitor_count); + assert(_held_monitor_count >= 0, "Must always be greater than 0: " INTX_FORMAT, _held_monitor_count); if (jni) { _jni_monitor_count -= i; - assert(_jni_monitor_count >= 0, "Must always be greater than 0: " INT64_FORMAT, (int64_t)_jni_monitor_count); + assert(_jni_monitor_count >= 0, "Must always be greater than 0: " INTX_FORMAT, _jni_monitor_count); } #endif } diff --git a/src/hotspot/share/runtime/javaThread.hpp b/src/hotspot/share/runtime/javaThread.hpp index f2cb56646d4..4aee26a8162 100644 --- a/src/hotspot/share/runtime/javaThread.hpp +++ b/src/hotspot/share/runtime/javaThread.hpp @@ -450,14 +450,10 @@ class JavaThread: public Thread { intptr_t* _cont_fastpath; // the sp of the oldest known interpreted/call_stub frame inside the // continuation that we know about int _cont_fastpath_thread_state; // whether global thread state allows continuation fastpath (JVMTI) + // It's signed for error detection. -#ifdef _LP64 - int64_t _held_monitor_count; // used by continuations for fast lock detection - int64_t _jni_monitor_count; -#else - int32_t _held_monitor_count; // used by continuations for fast lock detection - int32_t _jni_monitor_count; -#endif + intx _held_monitor_count; // used by continuations for fast lock detection + intx _jni_monitor_count; private: @@ -599,11 +595,11 @@ class JavaThread: public Thread { bool cont_fastpath() const { return _cont_fastpath == nullptr && _cont_fastpath_thread_state != 0; } bool cont_fastpath_thread_state() const { return _cont_fastpath_thread_state != 0; } - void inc_held_monitor_count(int i = 1, bool jni = false); - void dec_held_monitor_count(int i = 1, bool jni = false); + void inc_held_monitor_count(intx i = 1, bool jni = false); + void dec_held_monitor_count(intx i = 1, bool jni = false); - int64_t held_monitor_count() { return (int64_t)_held_monitor_count; } - int64_t jni_monitor_count() { return (int64_t)_jni_monitor_count; } + intx held_monitor_count() { return _held_monitor_count; } + intx jni_monitor_count() { return _jni_monitor_count; } void clear_jni_monitor_count() { _jni_monitor_count = 0; } inline bool is_vthread_mounted() const; diff --git a/src/hotspot/share/runtime/objectMonitor.hpp b/src/hotspot/share/runtime/objectMonitor.hpp index 92fb58dadb5..eeea6837e6f 100644 --- a/src/hotspot/share/runtime/objectMonitor.hpp +++ b/src/hotspot/share/runtime/objectMonitor.hpp @@ -235,7 +235,7 @@ class ObjectMonitor : public CHeapObj { // to the ObjectMonitor reference manipulation code: // #define OM_OFFSET_NO_MONITOR_VALUE_TAG(f) \ - ((in_bytes(ObjectMonitor::f ## _offset())) - markWord::monitor_value) + ((in_bytes(ObjectMonitor::f ## _offset())) - checked_cast(markWord::monitor_value)) markWord header() const; volatile markWord* header_addr(); diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 08d0b0066f4..965fd5603ba 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -136,11 +136,11 @@ char* os::iso8601_time(jlong milliseconds_since_19700101, char* buffer, size_t b assert(false, "buffer_length too small"); return nullptr; } - const int milliseconds_per_microsecond = 1000; + const int milliseconds_per_second = 1000; const time_t seconds_since_19700101 = - milliseconds_since_19700101 / milliseconds_per_microsecond; + milliseconds_since_19700101 / milliseconds_per_second; const int milliseconds_after_second = - milliseconds_since_19700101 % milliseconds_per_microsecond; + checked_cast(milliseconds_since_19700101 % milliseconds_per_second); // Convert the time value to a tm and timezone variable struct tm time_struct; if (utc) { diff --git a/src/hotspot/share/runtime/relocator.cpp b/src/hotspot/share/runtime/relocator.cpp index e61b9366321..da4da8a9e8d 100644 --- a/src/hotspot/share/runtime/relocator.cpp +++ b/src/hotspot/share/runtime/relocator.cpp @@ -295,7 +295,7 @@ void Relocator::change_jump(int bci, int offset, bool is_short, int break_bci, i if (is_short && ((new_delta > MAX_SHORT) || new_delta < MIN_SHORT)) { push_jump_widen(bci, delta, new_delta); } else if (is_short) { - short_at_put(offset, new_delta); + short_at_put(offset, checked_cast(new_delta)); } else { int_at_put(offset, new_delta); } @@ -397,13 +397,13 @@ void Relocator::adjust_exception_table(int bci, int delta) { ExceptionTable table(_method()); for (int index = 0; index < table.length(); index ++) { if (table.start_pc(index) > bci) { - table.set_start_pc(index, table.start_pc(index) + delta); - table.set_end_pc(index, table.end_pc(index) + delta); + table.set_start_pc(index, checked_cast(table.start_pc(index) + delta)); + table.set_end_pc(index, checked_cast(table.end_pc(index) + delta)); } else if (bci < table.end_pc(index)) { - table.set_end_pc(index, table.end_pc(index) + delta); + table.set_end_pc(index, checked_cast(table.end_pc(index) + delta)); } if (table.handler_pc(index) > bci) - table.set_handler_pc(index, table.handler_pc(index) + delta); + table.set_handler_pc(index, checked_cast(table.handler_pc(index) + delta)); } } @@ -449,11 +449,11 @@ void Relocator::adjust_local_var_table(int bci, int delta) { for (int i = 0; i < localvariable_table_length; i++) { u2 current_bci = table[i].start_bci; if (current_bci > bci) { - table[i].start_bci = current_bci + delta; + table[i].start_bci = checked_cast(current_bci + delta); } else { u2 current_length = table[i].length; if (current_bci + current_length > bci) { - table[i].length = current_length + delta; + table[i].length = checked_cast(current_length + delta); } } } @@ -531,7 +531,7 @@ void Relocator::adjust_stack_map_table(int bci, int delta) { // Now convert the frames in place if (frame->is_same_frame()) { - same_frame_extended::create_at(frame_addr, new_offset_delta); + same_frame_extended::create_at(frame_addr, checked_cast(new_offset_delta)); } else { same_locals_1_stack_item_extended::create_at( frame_addr, new_offset_delta, nullptr); @@ -549,7 +549,7 @@ void Relocator::adjust_stack_map_table(int bci, int delta) { for (int i = 0; i < number_of_types; ++i) { if (types->is_uninitialized() && types->bci() > bci) { - types->set_bci(types->bci() + delta); + types->set_bci(checked_cast(types->bci() + delta)); } types = types->next(); } @@ -562,7 +562,7 @@ void Relocator::adjust_stack_map_table(int bci, int delta) { types = ff->stack(eol); for (int i = 0; i < number_of_types; ++i) { if (types->is_uninitialized() && types->bci() > bci) { - types->set_bci(types->bci() + delta); + types->set_bci(checked_cast(types->bci() + delta)); } types = types->next(); } @@ -632,6 +632,7 @@ bool Relocator::relocate_code(int bci, int ilen, int delta) { memmove(addr_at(next_bci + delta), addr_at(next_bci), code_length() - next_bci); set_code_length(code_length() + delta); + // Also adjust exception tables... adjust_exception_table(bci, delta); // Line number tables... @@ -707,12 +708,12 @@ bool Relocator::handle_jump_widen(int bci, int delta) { if (!relocate_code(bci, 3, /*delta*/add_bci)) return false; // if bytecode points to goto_w instruction - short_at_put(bci + 1, ilen + goto_length); + short_at_put(bci + 1, checked_cast(ilen + goto_length)); int cbci = bci + ilen; // goto around code_at_put(cbci, Bytecodes::_goto); - short_at_put(cbci + 1, add_bci); + short_at_put(cbci + 1, checked_cast(add_bci)); // goto_w cbci = cbci + goto_length; code_at_put(cbci, Bytecodes::_goto_w); diff --git a/src/hotspot/share/runtime/safepoint.cpp b/src/hotspot/share/runtime/safepoint.cpp index 12a153b5e7e..c826119910b 100644 --- a/src/hotspot/share/runtime/safepoint.cpp +++ b/src/hotspot/share/runtime/safepoint.cpp @@ -95,7 +95,7 @@ static void post_safepoint_synchronize_event(EventSafepointStateSynchronization& uint64_t safepoint_id, int initial_number_of_threads, int threads_waiting_to_block, - uint64_t iterations) { + int iterations) { if (event.should_commit()) { event.set_safepointId(safepoint_id); event.set_initialThreadCount(initial_number_of_threads); diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index b641144b5e5..c65e12ad1f4 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -685,7 +685,7 @@ address SharedRuntime::compute_compiled_exc_handler(CompiledMethod* cm, address #if INCLUDE_JVMCI if (cm->is_compiled_by_jvmci()) { // lookup exception handler for this pc - int catch_pco = ret_pc - cm->code_begin(); + int catch_pco = pointer_delta_as_int(ret_pc, cm->code_begin()); ExceptionHandlerTable table(cm); HandlerTableEntry *t = table.entry_for(catch_pco, -1, 0); if (t != nullptr) { @@ -744,7 +744,7 @@ address SharedRuntime::compute_compiled_exc_handler(CompiledMethod* cm, address } // found handling method => lookup exception handler - int catch_pco = ret_pc - nm->code_begin(); + int catch_pco = pointer_delta_as_int(ret_pc, nm->code_begin()); ExceptionHandlerTable table(nm); HandlerTableEntry *t = table.entry_for(catch_pco, handler_bci, scope_depth); @@ -2309,7 +2309,7 @@ void SharedRuntime::print_statistics() { } inline double percent(int64_t x, int64_t y) { - return 100.0 * x / MAX2(y, (int64_t)1); + return 100.0 * (double)x / (double)MAX2(y, (int64_t)1); } class MethodArityHistogram { @@ -2345,13 +2345,13 @@ class MethodArityHistogram { const int N = MIN2(9, n); double sum = 0; double weighted_sum = 0; - for (int i = 0; i <= n; i++) { sum += histo[i]; weighted_sum += i*histo[i]; } - if (sum >= 1.0) { // prevent divide by zero or divide overflow + for (int i = 0; i <= n; i++) { sum += (double)histo[i]; weighted_sum += (double)(i*histo[i]); } + if (sum >= 1) { // prevent divide by zero or divide overflow double rest = sum; double percent = sum / 100; for (int i = 0; i <= N; i++) { - rest -= histo[i]; - tty->print_cr("%4d: " UINT64_FORMAT_W(12) " (%5.1f%%)", i, histo[i], histo[i] / percent); + rest -= (double)histo[i]; + tty->print_cr("%4d: " UINT64_FORMAT_W(12) " (%5.1f%%)", i, histo[i], (double)histo[i] / percent); } tty->print_cr("rest: " INT64_FORMAT_W(12) " (%5.1f%%)", (int64_t)rest, rest / percent); tty->print_cr("(avg. %s = %3.1f, max = %d)", name, weighted_sum / sum, n); diff --git a/src/hotspot/share/runtime/signature.cpp b/src/hotspot/share/runtime/signature.cpp index 30eae826c9f..b085bf5fd05 100644 --- a/src/hotspot/share/runtime/signature.cpp +++ b/src/hotspot/share/runtime/signature.cpp @@ -334,7 +334,7 @@ inline int SignatureStream::scan_type(BasicType type) { switch (type) { case T_OBJECT: tem = (const u1*) memchr(&base[end], JVM_SIGNATURE_ENDCLASS, limit - end); - return (tem == nullptr ? limit : tem + 1 - base); + return (tem == nullptr ? limit : pointer_delta_as_int(tem + 1, base)); case T_ARRAY: while ((end < limit) && ((char)base[end] == JVM_SIGNATURE_ARRAY)) { end++; } @@ -346,7 +346,7 @@ inline int SignatureStream::scan_type(BasicType type) { _array_prefix = end - _end; // number of '[' chars just skipped if (Signature::has_envelope(base[end])) { tem = (const u1 *) memchr(&base[end], JVM_SIGNATURE_ENDCLASS, limit - end); - return (tem == nullptr ? limit : tem + 1 - base); + return (tem == nullptr ? limit : pointer_delta_as_int(tem + 1, base)); } // Skipping over a single character for a primitive type. assert(is_java_primitive(decode_signature_char(base[end])), "only primitives expected"); diff --git a/src/hotspot/share/runtime/synchronizer.cpp b/src/hotspot/share/runtime/synchronizer.cpp index cbb38be7cb7..0d98e921470 100644 --- a/src/hotspot/share/runtime/synchronizer.cpp +++ b/src/hotspot/share/runtime/synchronizer.cpp @@ -1169,8 +1169,8 @@ static bool monitors_used_above_threshold(MonitorList* list) { } if (NoAsyncDeflationProgressMax != 0 && _no_progress_cnt >= NoAsyncDeflationProgressMax) { - float remainder = (100.0 - MonitorUsedDeflationThreshold) / 100.0; - size_t new_ceiling = ceiling + (ceiling * remainder) + 1; + double remainder = (100.0 - MonitorUsedDeflationThreshold) / 100.0; + size_t new_ceiling = ceiling + (size_t)((double)ceiling * remainder) + 1; ObjectSynchronizer::set_in_use_list_ceiling(new_ceiling); log_info(monitorinflation)("Too many deflations without progress; " "bumping in_use_list_ceiling from " SIZE_FORMAT @@ -1183,7 +1183,7 @@ static bool monitors_used_above_threshold(MonitorList* list) { size_t monitor_usage = (monitors_used * 100LL) / ceiling; if (int(monitor_usage) > MonitorUsedDeflationThreshold) { log_info(monitorinflation)("monitors_used=" SIZE_FORMAT ", ceiling=" SIZE_FORMAT - ", monitor_usage=" SIZE_FORMAT ", threshold=" INTX_FORMAT, + ", monitor_usage=" SIZE_FORMAT ", threshold=%d", monitors_used, ceiling, monitor_usage, MonitorUsedDeflationThreshold); return true; } diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index fd213086ccb..1f6ad8d7cc2 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -450,10 +450,10 @@ void Thread::print_on(outputStream* st, bool print_extended_info) const { } st->print("cpu=%.2fms ", - os::thread_cpu_time(const_cast(this), true) / 1000000.0 + (double)os::thread_cpu_time(const_cast(this), true) / 1000000.0 ); st->print("elapsed=%.2fs ", - _statistical_info.getElapsedTime() / 1000.0 + (double)_statistical_info.getElapsedTime() / 1000.0 ); if (is_Java_thread() && (PrintExtendedThreadInfo || print_extended_info)) { size_t allocated_bytes = (size_t) const_cast(this)->cooked_allocated_bytes(); diff --git a/src/hotspot/share/runtime/threadHeapSampler.cpp b/src/hotspot/share/runtime/threadHeapSampler.cpp index 3604b8d1709..03c845d6c2e 100644 --- a/src/hotspot/share/runtime/threadHeapSampler.cpp +++ b/src/hotspot/share/runtime/threadHeapSampler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, Google and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -356,7 +356,7 @@ double ThreadHeapSampler::fast_log2(const double& d) { assert(sizeof(d) == sizeof(x), "double and uint64_t do not have the same size"); x = *reinterpret_cast(&d); - const uint32_t x_high = x >> 32; + const uint32_t x_high = checked_cast(x >> 32); assert(FastLogNumBits <= 20, "FastLogNumBits should be less than 20."); const uint32_t y = x_high >> (20 - FastLogNumBits) & FastLogMask; const int32_t exponent = ((x_high >> 20) & 0x7FF) - 1023; diff --git a/src/hotspot/share/runtime/timer.cpp b/src/hotspot/share/runtime/timer.cpp index 2c90e5b160c..ca6681b47e4 100644 --- a/src/hotspot/share/runtime/timer.cpp +++ b/src/hotspot/share/runtime/timer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ double TimeHelper::counter_to_seconds(jlong counter) { double freq = (double) os::elapsed_frequency(); - return counter / freq; + return (double)counter / freq; } double TimeHelper::counter_to_millis(jlong counter) { diff --git a/src/hotspot/share/runtime/trimNativeHeap.cpp b/src/hotspot/share/runtime/trimNativeHeap.cpp index 7700c8e5109..3592d390938 100644 --- a/src/hotspot/share/runtime/trimNativeHeap.cpp +++ b/src/hotspot/share/runtime/trimNativeHeap.cpp @@ -116,8 +116,8 @@ class NativeHeapTrimmerThread : public NamedThread { ml.wait(0); // infinite } else if (next_trim_time > tnow) { times_waited ++; - const int64_t wait_ms = MAX2(1.0, to_ms(next_trim_time - tnow)); - ml.wait(wait_ms); + const double wait_ms = MAX2(1.0, to_ms(next_trim_time - tnow)); + ml.wait((int64_t)wait_ms); } else if (at_or_nearing_safepoint()) { times_safepoint ++; const int64_t wait_ms = MIN2(TrimNativeHeapInterval, safepoint_poll_ms); diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 2a2fc9acc74..fb9d5d86c5d 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -947,9 +947,6 @@ static_field(Abstract_VM_Version, _vm_security_version, int) \ static_field(Abstract_VM_Version, _vm_build_number, int) \ \ - static_field(JDK_Version, _current, JDK_Version) \ - nonstatic_field(JDK_Version, _major, unsigned char) \ - \ /*************************/ \ /* JVMTI */ \ /*************************/ \ @@ -1873,7 +1870,6 @@ /********************/ \ \ declare_toplevel_type(Abstract_VM_Version) \ - declare_toplevel_type(JDK_Version) \ \ /*************/ \ /* Arguments */ \ @@ -3037,7 +3033,7 @@ static int recursiveFindType(VMTypeEntry* origtypes, const char* typeName, bool } if (start != nullptr) { const char * end = strrchr(typeName, '>'); - int len = end - start + 1; + int len = pointer_delta_as_int(end, start) + 1; char * s = NEW_C_HEAP_ARRAY(char, len, mtInternal); strncpy(s, start, len - 1); s[len-1] = '\0'; diff --git a/src/hotspot/share/services/attachListener.cpp b/src/hotspot/share/services/attachListener.cpp index 50830c4bf2a..a8f7256763a 100644 --- a/src/hotspot/share/services/attachListener.cpp +++ b/src/hotspot/share/services/attachListener.cpp @@ -234,13 +234,13 @@ jint dump_heap(AttachOperation* op, outputStream* out) { } const char* num_str = op->arg(2); - uintx level = 0; + uint level = 0; if (num_str != nullptr && num_str[0] != '\0') { - if (!Arguments::parse_uintx(num_str, &level, 0)) { + if (!Arguments::parse_uint(num_str, &level, 0)) { out->print_cr("Invalid compress level: [%s]", num_str); return JNI_ERR; } else if (level < 1 || level > 9) { - out->print_cr("Compression level out of range (1-9): " UINTX_FORMAT, level); + out->print_cr("Compression level out of range (1-9): %u", level); return JNI_ERR; } } @@ -249,7 +249,7 @@ jint dump_heap(AttachOperation* op, outputStream* out) { // This helps reduces the amount of unreachable objects in the dump // and makes it easier to browse. HeapDumper dumper(live_objects_only /* request GC */); - dumper.dump(path, out, (int)level, false, HeapDumper::default_num_of_dump_threads()); + dumper.dump(path, out, level, false, HeapDumper::default_num_of_dump_threads()); } return JNI_OK; } @@ -287,13 +287,13 @@ static jint heap_inspection(AttachOperation* op, outputStream* out) { const char* num_str = op->arg(2); if (num_str != nullptr && num_str[0] != '\0') { - uintx num; - if (!Arguments::parse_uintx(num_str, &num, 0)) { + uint num; + if (!Arguments::parse_uint(num_str, &num, 0)) { out->print_cr("Invalid parallel thread number: [%s]", num_str); delete fs; return JNI_ERR; } - parallel_thread_num = num == 0 ? parallel_thread_num : (uint)num; + parallel_thread_num = num == 0 ? parallel_thread_num : num; } VM_GC_HeapInspection heapop(os, live_objects_only /* request full gc */, parallel_thread_num); diff --git a/test/hotspot/gtest/runtime/test_os.cpp b/test/hotspot/gtest/runtime/test_os.cpp index d44dc3216ee..81c72d88556 100644 --- a/test/hotspot/gtest/runtime/test_os.cpp +++ b/test/hotspot/gtest/runtime/test_os.cpp @@ -144,10 +144,10 @@ TEST(os, test_random) { ASSERT_EQ(num, 1043618065) << "bad seed"; // tty->print_cr("mean of the 1st 10000 numbers: %f", mean); - int intmean = mean*100; + int intmean = (int)(mean*100); ASSERT_EQ(intmean, 50); // tty->print_cr("variance of the 1st 10000 numbers: %f", variance); - int intvariance = variance*100; + int intvariance = (int)(variance*100); ASSERT_EQ(intvariance, 33); const double eps = 0.0001; t = fabsd(mean - 0.5018); @@ -223,7 +223,7 @@ TEST_VM(os, test_print_hex_dump) { // Test dumping readable memory address arr = (address)os::malloc(100, mtInternal); - for (int c = 0; c < 100; c++) { + for (u1 c = 0; c < 100; c++) { arr[c] = c; } diff --git a/test/hotspot/gtest/runtime/test_stubRoutines.cpp b/test/hotspot/gtest/runtime/test_stubRoutines.cpp index 1dc1d0197b5..14673046b9b 100644 --- a/test/hotspot/gtest/runtime/test_stubRoutines.cpp +++ b/test/hotspot/gtest/runtime/test_stubRoutines.cpp @@ -30,8 +30,8 @@ typedef void (*arraycopy_fn)(address src, address dst, int count); // simple tests of generated arraycopy functions static void test_arraycopy_func(address func, int alignment) { - int v = 0xcc; - int v2 = 0x11; + u_char v = 0xcc; + u_char v2 = 0x11; jlong lbuffer[8]; jlong lbuffer2[8]; address fbuffer = (address) lbuffer; From 23fe2ece586d3ed750e905e1b71a2cd1da91f335 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 10 Aug 2023 12:06:43 +0000 Subject: [PATCH 009/162] 8313616: support loading library members on AIX in os::dll_load Reviewed-by: mdoerr --- src/hotspot/os/aix/libodm_aix.cpp | 9 ++++++--- src/hotspot/os/aix/libperfstat_aix.cpp | 9 +++++---- src/hotspot/os/aix/os_aix.cpp | 15 +++++++++++---- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/hotspot/os/aix/libodm_aix.cpp b/src/hotspot/os/aix/libodm_aix.cpp index db8e8a5d960..d62a94939a4 100644 --- a/src/hotspot/os/aix/libodm_aix.cpp +++ b/src/hotspot/os/aix/libodm_aix.cpp @@ -29,13 +29,16 @@ #include #include #include "runtime/arguments.hpp" +#include "runtime/os.hpp" dynamicOdm::dynamicOdm() { - const char *libodmname = "/usr/lib/libodm.a(shr_64.o)"; - _libhandle = dlopen(libodmname, RTLD_MEMBER | RTLD_NOW); + const char* libodmname = "/usr/lib/libodm.a(shr_64.o)"; + char ebuf[512]; + void* _libhandle = os::dll_load(libodmname, ebuf, sizeof(ebuf)); + if (!_libhandle) { - trcVerbose("Couldn't open %s", libodmname); + trcVerbose("Cannot load %s (error %s)", libodmname, ebuf); return; } _odm_initialize = (fun_odm_initialize )dlsym(_libhandle, "odm_initialize" ); diff --git a/src/hotspot/os/aix/libperfstat_aix.cpp b/src/hotspot/os/aix/libperfstat_aix.cpp index 79b8f09cc65..69f62245365 100644 --- a/src/hotspot/os/aix/libperfstat_aix.cpp +++ b/src/hotspot/os/aix/libperfstat_aix.cpp @@ -26,6 +26,7 @@ #include "libperfstat_aix.hpp" #include "misc_aix.hpp" +#include "runtime/os.hpp" #include @@ -71,11 +72,11 @@ static fun_perfstat_reset_t g_fun_perfstat_reset = nullptr; static fun_wpar_getcid_t g_fun_wpar_getcid = nullptr; bool libperfstat::init() { - - // Dynamically load the libperfstat porting library. - g_libhandle = dlopen("/usr/lib/libperfstat.a(shr_64.o)", RTLD_MEMBER | RTLD_NOW); + const char* libperfstat = "/usr/lib/libperfstat.a(shr_64.o)"; + char ebuf[512]; + g_libhandle = os::dll_load(libperfstat, ebuf, sizeof(ebuf)); if (!g_libhandle) { - trcVerbose("Cannot load libperfstat.a (dlerror: %s)", dlerror()); + trcVerbose("Cannot load %s (error: %s)", libperfstat, ebuf); return false; } diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index e657431f125..98b689d4530 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -1101,8 +1101,6 @@ bool os::dll_address_to_library_name(address addr, char* buf, return true; } -// Loads .dll/.so and in case of error it checks if .dll/.so was built -// for the same architecture as Hotspot is running on. void *os::dll_load(const char *filename, char *ebuf, int ebuflen) { log_info(os)("attempting shared library load of %s", filename); @@ -1122,8 +1120,17 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) { event.set_name(filename); #endif - // RTLD_LAZY is currently not implemented. The dl is loaded immediately with all its dependants. - void * result= ::dlopen(filename, RTLD_LAZY); + // RTLD_LAZY has currently the same behavior as RTLD_NOW + // The dl is loaded immediately with all its dependants. + int dflags = RTLD_LAZY; + // check for filename ending with ')', it indicates we want to load + // a MEMBER module that is a member of an archive. + int flen = strlen(filename); + if (flen > 0 && filename[flen - 1] == ')') { + dflags |= RTLD_MEMBER; + } + + void * result= ::dlopen(filename, dflags); if (result != nullptr) { Events::log_dll_message(nullptr, "Loaded shared library %s", filename); // Reload dll cache. Don't do this in signal handling. From e7c83ea948f8b2cd7caf7e59d3cf6b087807dba7 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Thu, 10 Aug 2023 15:18:34 +0000 Subject: [PATCH 010/162] 8312194: test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java cannot handle empty modules Reviewed-by: kvn, thartmann --- test/hotspot/jtreg/ProblemList.txt | 1 - .../ctw/modules/jdk_crypto_ec.java | 38 ------------------- 2 files changed, 39 deletions(-) delete mode 100644 test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 32947670690..4b85f929999 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -105,7 +105,6 @@ runtime/ErrorHandling/TestDwarf.java 8305489 linux-all runtime/ErrorHandling/MachCodeFramesInErrorFile.java 8313315 linux-ppc64le applications/jcstress/copy.java 8229852 linux-all -applications/ctw/modules/jdk_crypto_ec.java 8312194 generic-all containers/docker/TestJcmd.java 8278102 linux-all containers/docker/TestMemoryAwareness.java 8303470 linux-x64 diff --git a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java b/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java deleted file mode 100644 index 09e173b4801..00000000000 --- a/test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary run CTW for all classes from jdk.crypto.ec module - * - * @library /test/lib / /testlibrary/ctw/src - * @modules java.base/jdk.internal.access - * java.base/jdk.internal.jimage - * java.base/jdk.internal.misc - * java.base/jdk.internal.reflect - * @modules jdk.crypto.ec - * - * @build jdk.test.whitebox.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.crypto.ec - */ From 9b53251131c67b1abb69b59eb66a1a133acc41d9 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Thu, 10 Aug 2023 15:18:57 +0000 Subject: [PATCH 011/162] 8313654: Test WaitNotifySuspendedVThreadTest.java timed out Reviewed-by: sspitsyn --- .../WaitNotifySuspendedVThreadTest.java | 18 ++---------------- .../libWaitNotifySuspendedVThread.cpp | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/WaitNotifySuspendedVThreadTest/WaitNotifySuspendedVThreadTest.java b/test/hotspot/jtreg/serviceability/jvmti/vthread/WaitNotifySuspendedVThreadTest/WaitNotifySuspendedVThreadTest.java index 341890ba4a0..a7b4b6ff43c 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/vthread/WaitNotifySuspendedVThreadTest/WaitNotifySuspendedVThreadTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/WaitNotifySuspendedVThreadTest/WaitNotifySuspendedVThreadTest.java @@ -24,20 +24,8 @@ /* * @test * - * @summary Test verifies set/get TLS data and verifies it's consistency. - * Test set TLS with thread name which it belongs to and verify this information when getting test. - * -- cbThreadStart - * -- by AgentThread - * - * Test doesn't verify that TLS is not NULL because for some threads TLS is not initialized initially. - * TODO: - * -- verify that TLS is not NULL (not possible to do with jvmti, ThreadStart might be called too late) - * -- add more events where TLS is set *first time*, it is needed to test lazily jvmtThreadState init - * -- set/get TLS from other JavaThreads (not from agent and current thread) - * -- set/get for suspened (blocked?) threads - * -- split test to "sanity" and "stress" version - * -- update properties to run jvmti stress tests non-concurrently? - * + * @summary Test verifies that JVMTI raw monitor wait/notify works for + * suspended virtual thread. * * @requires vm.continuations * @library /test/lib @@ -64,8 +52,6 @@ public static void main(String argv[]) throws InterruptedException { WaitNotifySuspendedVThreadTask.setBreakpoint(); WaitNotifySuspendedVThreadTask task = new WaitNotifySuspendedVThreadTask(); Thread t = Thread.ofVirtual().start(task); - - Thread.sleep(1000); WaitNotifySuspendedVThreadTask.notifyRawMonitors(t); t.join(); } diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/WaitNotifySuspendedVThreadTest/libWaitNotifySuspendedVThread.cpp b/test/hotspot/jtreg/serviceability/jvmti/vthread/WaitNotifySuspendedVThreadTest/libWaitNotifySuspendedVThread.cpp index 41bd2177646..e6ad883944a 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/vthread/WaitNotifySuspendedVThreadTest/libWaitNotifySuspendedVThread.cpp +++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/WaitNotifySuspendedVThreadTest/libWaitNotifySuspendedVThread.cpp @@ -30,6 +30,8 @@ jrawMonitorID monitor_completed; jvmtiEnv *jvmti_env; +// Accessed using 'monitor' monitor. +bool is_breakpoint_reached = JNI_FALSE; static void set_breakpoint(JNIEnv *jni, jclass klass, const char *mname) { @@ -42,8 +44,6 @@ set_breakpoint(JNIEnv *jni, jclass klass, const char *mname) { } err = jvmti_env->SetBreakpoint(method, location); check_jvmti_status(jni, err, "set_or_clear_breakpoint: error in JVMTI SetBreakpoint"); - - } extern "C" { @@ -60,17 +60,26 @@ Java_WaitNotifySuspendedVThreadTask_setBreakpoint(JNIEnv *jni, jclass klass) { check_jvmti_status(jni, err, "enableEvents: error in JVMTI SetEventNotificationMode: enable BREAKPOINT"); LOG("setBreakpoint: finished\n"); - } JNIEXPORT void JNICALL Java_WaitNotifySuspendedVThreadTask_notifyRawMonitors(JNIEnv *jni, jclass klass, jthread thread) { + + // Wait until virtual thread reach breakpoint and lock 'montior' monitor + bool is_breakpoint_reached_local = JNI_FALSE; + while (!is_breakpoint_reached_local) { + RawMonitorLocker rml(jvmti_env, jni, monitor); + is_breakpoint_reached_local = is_breakpoint_reached; + } + LOG("Main thread: suspending virtual and carrier threads\n"); check_jvmti_status(jni, jvmti_env->SuspendThread(thread), "SuspendThread thread"); jthread cthread = get_carrier_thread(jvmti_env, jni, thread); check_jvmti_status(jni, jvmti_env->SuspendThread(cthread), "SuspendThread thread"); + RawMonitorLocker completed(jvmti_env, jni, monitor_completed); + { RawMonitorLocker rml(jvmti_env, jni, monitor); @@ -78,8 +87,6 @@ Java_WaitNotifySuspendedVThreadTask_notifyRawMonitors(JNIEnv *jni, jclass klass, rml.notify_all(); } - RawMonitorLocker completed(jvmti_env, jni, monitor_completed); - LOG("Main thread: resuming virtual thread\n"); check_jvmti_status(jni, jvmti_env->ResumeThread(thread), "ResumeThread thread"); @@ -104,6 +111,7 @@ Breakpoint(jvmtiEnv *jvmti, JNIEnv* jni, jthread thread, fatal(jni, "Error in breakpoint"); return; } + char* tname = get_thread_name(jvmti, jni, thread); const char* virt = jni->IsVirtualThread(thread) ? "virtual" : "carrier"; @@ -111,6 +119,7 @@ Breakpoint(jvmtiEnv *jvmti, JNIEnv* jni, jthread thread, RawMonitorLocker rml(jvmti, jni, monitor); LOG("Breakpoint: before monitor.wait(): %s in %s thread\n", mname, virt); + is_breakpoint_reached = JNI_TRUE; rml.wait(); LOG("Breakpoint: after monitor.wait(): %s in %s thread\n", mname, virt); } From bd1b9427410c458215e9e89eeff6e4d30592a4a4 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 10 Aug 2023 15:25:00 +0000 Subject: [PATCH 012/162] 8313905: Checked_cast assert in CDS compare_by_loader Reviewed-by: dlong, iklam --- src/hotspot/share/classfile/systemDictionaryShared.cpp | 4 ++-- src/hotspot/share/utilities/globalDefinitions.hpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/classfile/systemDictionaryShared.cpp b/src/hotspot/share/classfile/systemDictionaryShared.cpp index 9f37e2dcff8..d6ac0877eeb 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.cpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp @@ -597,9 +597,9 @@ class UnregisteredClassesDuplicationChecker : StackObj { ClassLoaderData* loader_b = b[0]->class_loader_data(); if (loader_a != loader_b) { - return checked_cast(intptr_t(loader_a) - intptr_t(loader_b)); + return primitive_compare(loader_a, loader_b); } else { - return checked_cast(intptr_t(a[0]) - intptr_t(b[0])); + return primitive_compare(a[0], b[0]); } } diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp index 762020741db..a374b9cdc93 100644 --- a/src/hotspot/share/utilities/globalDefinitions.hpp +++ b/src/hotspot/share/utilities/globalDefinitions.hpp @@ -1334,6 +1334,10 @@ template bool primitive_equals(const K& k0, const K& k1) { return k0 == k1; } +template int primitive_compare(const K& k0, const K& k1) { + return ((k0 < k1) ? -1 : (k0 == k1) ? 0 : 1); +} + //---------------------------------------------------------------------------------------------------- // Allow use of C++ thread_local when approved - see JDK-8282469. From 1875b2872baa566fa11f92006c8eba7642267213 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Thu, 10 Aug 2023 16:40:28 +0000 Subject: [PATCH 013/162] 8314061: [JVMCI] DeoptimizeALot stress logic breaks deferred barriers Reviewed-by: thartmann, dnsimon --- src/hotspot/share/jvmci/jvmciRuntime.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp index 12616d26b46..b9cb9a390fd 100644 --- a/src/hotspot/share/jvmci/jvmciRuntime.cpp +++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp @@ -174,7 +174,6 @@ JRT_BLOCK_ENTRY(void, JVMCIRuntime::new_array_common(JavaThread* current, Klass* RetryableAllocationMark ram(current, null_on_fail); obj = oopFactory::new_objArray(elem_klass, length, CHECK); } - current->set_vm_result(obj); // This is pretty rare but this runtime patch is stressful to deoptimization // if we deoptimize here so force a deopt to stress the path. if (DeoptimizeALot) { @@ -182,7 +181,8 @@ JRT_BLOCK_ENTRY(void, JVMCIRuntime::new_array_common(JavaThread* current, Klass* // Alternate between deoptimizing and raising an error (which will also cause a deopt) if (deopts++ % 2 == 0) { if (null_on_fail) { - return; + // Drop the allocation + obj = nullptr; } else { ResourceMark rm(current); THROW(vmSymbols::java_lang_OutOfMemoryError()); @@ -191,6 +191,7 @@ JRT_BLOCK_ENTRY(void, JVMCIRuntime::new_array_common(JavaThread* current, Klass* deopt_caller(); } } + current->set_vm_result(obj); JRT_BLOCK_END; SharedRuntime::on_slowpath_allocation_exit(current); JRT_END From 79be8d9383c31be64e57ce1825a79dbbc2aefdd8 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Thu, 10 Aug 2023 17:15:56 +0000 Subject: [PATCH 014/162] 8312259: StatusResponseManager unused code clean up Reviewed-by: mpowers, jnimeh --- .../security/ssl/StatusResponseManager.java | 144 +----------------- .../ssl/StatusResponseManagerTests.java | 43 ++++-- 2 files changed, 31 insertions(+), 156 deletions(-) diff --git a/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java b/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java index c86fa1c7dc6..efb9c9c30f9 100644 --- a/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java +++ b/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java @@ -105,74 +105,6 @@ final class StatusResponseManager { cacheCapacity, cacheLifetime); } - /** - * Get the current cache lifetime setting - * - * @return the current cache lifetime value - */ - int getCacheLifetime() { - return cacheLifetime; - } - - /** - * Get the current maximum cache size. - * - * @return the current maximum cache size - */ - int getCacheCapacity() { - return cacheCapacity; - } - - /** - * Get the default OCSP responder URI, if previously set. - * - * @return the current default OCSP responder URI, or {@code null} if - * it has not been set. - */ - URI getDefaultResponder() { - return defaultResponder; - } - - /** - * Get the URI override setting - * - * @return {@code true} if URI override has been set, {@code false} - * otherwise. - */ - boolean getURIOverride() { - return respOverride; - } - - /** - * Get the ignore extensions setting. - * - * @return {@code true} if the {@code StatusResponseManager} will not - * pass OCSP Extensions in the TLS {@code status_request[_v2]} - * extensions, {@code false} if extensions will be passed (the default). - */ - boolean getIgnoreExtensions() { - return ignoreExtensions; - } - - /** - * Clear the status response cache - */ - void clear() { - if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { - SSLLogger.fine("Clearing response cache"); - } - responseCache.clear(); - } - - /** - * Returns the number of currently valid objects in the response cache. - * - * @return the number of valid objects in the response cache. - */ - int size() { - return responseCache.size(); - } - /** * Obtain the URI use by the {@code StatusResponseManager} during * lookups. @@ -211,17 +143,6 @@ URI getURI(X509Certificate cert) { } } - /** - * Shutdown the thread pool - */ - void shutdown() { - if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { - SSLLogger.fine("Shutting down " + threadMgr.getActiveCount() + - " active threads"); - } - threadMgr.shutdown(); - } - /** * Get a list of responses for a chain of certificates. * @@ -447,20 +368,6 @@ class StatusInfo { final URI responder; ResponseCacheEntry responseData; - /** - * Create a StatusInfo object from certificate data. - * - * @param subjectCert the certificate to be checked for revocation - * @param issuerCert the issuer of the {@code subjectCert} - * - * @throws IOException if CertId creation from the certificate fails - */ - StatusInfo(X509Certificate subjectCert, X509Certificate issuerCert) - throws IOException { - this(subjectCert, new CertId(issuerCert, - new SerialNumber(subjectCert.getSerialNumber()))); - } - /** * Create a StatusInfo object from an existing subject certificate * and its corresponding CertId. @@ -475,21 +382,6 @@ class StatusInfo { responseData = null; } - /** - * Copy constructor (used primarily for rescheduling). - * This will do a member-wise copy except for the - * responseData and extensions fields, which should not persist - * in a rescheduled fetch. - * - * @param orig the original {@code StatusInfo} - */ - StatusInfo(StatusInfo orig) { - this.cert = orig.cert; - this.cid = orig.cid; - this.responder = orig.responder; - this.responseData = null; - } - /** * Return a String representation of the {@code StatusInfo} * @@ -687,38 +579,6 @@ private void addToCache(CertId certId, ResponseCacheEntry entry) { } } - /** - * Determine the delay to use when scheduling the task that will - * update the OCSP response. This is the shorter time between the - * cache lifetime and the nextUpdate. If no nextUpdate is present - * in the response, then only the cache lifetime is used. - * If cache timeouts are disabled (a zero value) and there's no - * nextUpdate, then the entry is not cached and no rescheduling - * will take place. - * - * @param nextUpdate a {@code Date} object corresponding to the - * next update time from a SingleResponse. - * - * @return the number of seconds of delay before the next fetch - * should be executed. A zero value means that the fetch - * should happen immediately, while a value less than zero - * indicates no rescheduling should be done. - */ - private long getNextTaskDelay(Date nextUpdate) { - long delaySec; - int lifetime = getCacheLifetime(); - - if (nextUpdate != null) { - long nuDiffSec = (nextUpdate.getTime() - - System.currentTimeMillis()) / 1000; - delaySec = lifetime > 0 ? Long.min(nuDiffSec, lifetime) : - nuDiffSec; - } else { - delaySec = lifetime > 0 ? lifetime : -1; - } - - return delaySec; - } } static final StaplingParameters processStapling( @@ -884,7 +744,7 @@ static final StaplingParameters processStapling( // response cannot be zero length if (type == CertStatusRequestType.OCSP) { byte[] respDER = responses.get(certs[0]); - if (respDER == null || respDER.length <= 0) { + if (respDER == null || respDER.length == 0) { if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { SSLLogger.finest("Warning: Null or zero-length " + @@ -909,7 +769,6 @@ static final StaplingParameters processStapling( "of the StatusResponseManager failed. " + "Stapling is disabled."); } - params = null; } return params; @@ -934,4 +793,3 @@ static final class StaplingParameters { } } } - diff --git a/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java b/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java index 07058a29c25..f6b0d1f10e2 100644 --- a/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java +++ b/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java @@ -24,6 +24,7 @@ package sun.security.ssl; import java.io.IOException; +import java.lang.reflect.Field; import java.math.BigInteger; import java.security.cert.*; import java.util.*; @@ -49,6 +50,8 @@ public class StatusResponseManagerTests { private static final boolean debug = true; private static final boolean ocspDebug = false; + private static Field responseCacheField; + // PKI components we will need for this test static String passwd = "passphrase"; static String ROOT_ALIAS = "root"; @@ -69,6 +72,10 @@ public class StatusResponseManagerTests { static X509Certificate[] chain; public static void main(String[] args) throws Exception { + responseCacheField = + StatusResponseManager.class.getDeclaredField("responseCache"); + responseCacheField.setAccessible(true); + Map testList = new LinkedHashMap() {{ put("Basic OCSP fetch test", testOcspFetch); @@ -118,9 +125,9 @@ public Map.Entry runTest() { } else if (!responseMap.containsKey(sslCert)) { message = "Response map key is incorrect, expected " + sslCert.getSubjectX500Principal().toString(); - } else if (srm.size() != 1) { + } else if (responseCacheSize(srm) != 1) { message = "Incorrect number of cache entries: " + - "expected 1, got " + srm.size(); + "expected 1, got " + responseCacheSize(srm); } else { pass = Boolean.TRUE; } @@ -149,15 +156,15 @@ public Map.Entry runTest() { // There should be two entries in the returned map and // two entries in the cache when the operation is complete. - if (srm.size() != 2) { + if (responseCacheSize(srm) != 2) { message = "Incorrect number of responses: expected 2, got " - + srm.size(); + + responseCacheSize(srm); } else { // Next, clear the SRM, then check the size again - srm.clear(); - if (srm.size() != 0) { + clearResponseCache(srm); + if (responseCacheSize(srm) != 0) { message = "Incorrect number of responses: expected 0," + - " got " + srm.size(); + " got " + responseCacheSize(srm); } else { pass = Boolean.TRUE; } @@ -197,9 +204,9 @@ public Map.Entry runTest() { sslCert.getSubjectX500Principal().toString() + " and " + intCert.getSubjectX500Principal().toString(); - } else if (srm.size() != 2) { + } else if (responseCacheSize(srm) != 2) { message = "Incorrect number of cache entries: " + - "expected 2, got " + srm.size(); + "expected 2, got " + responseCacheSize(srm); } else { pass = Boolean.TRUE; } @@ -230,16 +237,16 @@ public Map.Entry runTest() { // There should be two entries in the returned map and // two entries in the cache when the operation is complete. - if (srm.size() != 2) { + if (responseCacheSize(srm) != 2) { message = "Incorrect number of responses: expected 2, got " - + srm.size(); + + responseCacheSize(srm); } else { // Next, wait for more than 5 seconds so the responses // in the SRM will expire. Thread.sleep(7000); - if (srm.size() != 0) { + if (responseCacheSize(srm) != 0) { message = "Incorrect number of responses: expected 0," + - " got " + srm.size(); + " got " + responseCacheSize(srm); } else { pass = Boolean.TRUE; } @@ -426,6 +433,16 @@ private static void addCommonCAExts(CertificateBuilder cbld) cbld.addKeyUsageExt(kuBitSettings); } + private static int responseCacheSize( + StatusResponseManager srm) throws IllegalAccessException { + return ((sun.security.util.Cache)responseCacheField.get(srm)).size(); + } + + private static void clearResponseCache( + StatusResponseManager srm) throws IllegalAccessException { + ((sun.security.util.Cache)responseCacheField.get(srm)).clear(); + } + /** * Helper routine that dumps only a few cert fields rather than * the whole toString() output. From d97de8260c19e468c87221e28f29128e56ec8ee1 Mon Sep 17 00:00:00 2001 From: Damon Nguyen Date: Thu, 10 Aug 2023 17:52:28 +0000 Subject: [PATCH 015/162] 8313633: [macOS] java/awt/dnd/NextDropActionTest/NextDropActionTest.java fails with java.lang.RuntimeException: wrong next drop action! Reviewed-by: honkar, serb --- .../dnd/NextDropActionTest/NextDropActionTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/jdk/java/awt/dnd/NextDropActionTest/NextDropActionTest.java b/test/jdk/java/awt/dnd/NextDropActionTest/NextDropActionTest.java index e4d61a5d166..04acf61e11a 100644 --- a/test/jdk/java/awt/dnd/NextDropActionTest/NextDropActionTest.java +++ b/test/jdk/java/awt/dnd/NextDropActionTest/NextDropActionTest.java @@ -88,7 +88,7 @@ public void start() throws InterruptedException, final DragSourceListener dsl = new DragSourceAdapter() { boolean firstCall = true; public void dragDropEnd(DragSourceDropEvent e) { - System.err.println("DragSourseListener.dragDropEnd(): " + + System.err.println("DragSourceListener.dragDropEnd(): " + " firstCall=" + firstCall + " drop action=" + e.getDropAction()); if (firstCall) { @@ -140,18 +140,22 @@ public void drop(DropTargetDropEvent e) { robot.keyRelease(KeyEvent.VK_CONTROL); LOCK.wait(WAIT_TIMEOUT); } + if (!firstEnd) { - System.err.println("DragSourseListener.dragDropEnd() " + + System.err.println("DragSourceListener.dragDropEnd() " + "was not called, returning"); return; } + robot.delay(1000); + synchronized (LOCK) { Util.doDragDrop(robot, startPoint, endPoint); LOCK.wait(WAIT_TIMEOUT); } + if (!secondEnd) { - System.err.println("DragSourseListener.dragDropEnd() " + + System.err.println("DragSourceListener.dragDropEnd() " + "was not called, returning"); return; } @@ -171,7 +175,7 @@ public void drop(DropTargetDropEvent e) { class Util { public static int sign(int n) { - return n < 0 ? -1 : n == 0 ? 0 : 1; + return Integer.compare(n, 0); } public static void doDragDrop(Robot robot, Point startPoint, Point endPoint) { From 6f5c903d10aa5f7ff979a79f121609c167f88eff Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Thu, 10 Aug 2023 18:53:02 +0000 Subject: [PATCH 016/162] 8313899: JVMCI exception Translation can fail in TranslatedException. Reviewed-by: never, thartmann --- src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 13 +++++++++++++ src/hotspot/share/jvmci/jvmciEnv.cpp | 14 ++++++++++++-- src/hotspot/share/jvmci/jvmciRuntime.cpp | 4 ++++ .../jdk/internal/vm/TranslatedException.java | 19 +++++++++++++++++++ .../TestUncaughtErrorInCompileMethod.java | 3 +++ .../hotspot/test/TestHotSpotJVMCIRuntime.java | 8 ++++++++ 6 files changed, 59 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index a6efcd3aff8..0b6a821b74b 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -52,6 +52,7 @@ #include "prims/jvmtiExport.hpp" #include "prims/methodHandles.hpp" #include "prims/nativeLookup.hpp" +#include "runtime/arguments.hpp" #include "runtime/atomic.hpp" #include "runtime/deoptimization.hpp" #include "runtime/fieldDescriptor.inline.hpp" @@ -585,6 +586,18 @@ C2V_VMENTRY_NULL(jobject, lookupType, (JNIEnv* env, jobject, jstring jname, ARGU JVMCI_THROW_MSG_0(InternalError, err_msg("Primitive type %s should be handled in Java code", str)); } +#ifdef ASSERT + const char* val = Arguments::PropertyList_get_value(Arguments::system_properties(), "test.jvmci.lookupTypeException"); + if (val != nullptr) { + if (strstr(val, "") != nullptr) { + tty->print_cr("CompilerToVM.lookupType: %s", str); + } else if (strstr(val, str) != nullptr) { + THROW_MSG_0(vmSymbols::java_lang_Exception(), + err_msg("lookupTypeException: %s", str)); + } + } +#endif + JVMCIKlassHandle resolved_klass(THREAD); Klass* accessing_klass = UNPACK_PAIR(Klass, accessing_klass); Handle class_loader; diff --git a/src/hotspot/share/jvmci/jvmciEnv.cpp b/src/hotspot/share/jvmci/jvmciEnv.cpp index 217725f256d..e70f2785426 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.cpp +++ b/src/hotspot/share/jvmci/jvmciEnv.cpp @@ -433,8 +433,7 @@ class HotSpotToSharedLibraryExceptionTranslation : public ExceptionTranslation { private: const Handle& _throwable; - int encode(JavaThread* THREAD, jlong buffer, int buffer_size) { - Klass* vmSupport = SystemDictionary::resolve_or_fail(vmSymbols::jdk_internal_vm_VMSupport(), true, THREAD); + bool handle_pending_exception(JavaThread* THREAD, jlong buffer, int buffer_size) { if (HAS_PENDING_EXCEPTION) { Handle throwable = Handle(THREAD, PENDING_EXCEPTION); Symbol *ex_name = throwable->klass()->name(); @@ -451,6 +450,14 @@ class HotSpotToSharedLibraryExceptionTranslation : public ExceptionTranslation { JVMCI_event_1("error translating exception: %s", char_buffer); decode(THREAD, _encode_fail, buffer); } + return true; + } + return false; + } + + int encode(JavaThread* THREAD, jlong buffer, int buffer_size) { + Klass* vmSupport = SystemDictionary::resolve_or_fail(vmSymbols::jdk_internal_vm_VMSupport(), true, THREAD); + if (handle_pending_exception(THREAD, buffer, buffer_size)) { return 0; } JavaCallArguments jargs; @@ -462,6 +469,9 @@ class HotSpotToSharedLibraryExceptionTranslation : public ExceptionTranslation { vmSupport, vmSymbols::encodeThrowable_name(), vmSymbols::encodeThrowable_signature(), &jargs, THREAD); + if (handle_pending_exception(THREAD, buffer, buffer_size)) { + return 0; + } return result.get_jint(); } diff --git a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp index b9cb9a390fd..f8c3c432d83 100644 --- a/src/hotspot/share/jvmci/jvmciRuntime.cpp +++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp @@ -1247,11 +1247,13 @@ JNIEnv* JVMCIRuntime::init_shared_library_javavm(int* create_JavaVM_err) { MutexLocker locker(_lock); JavaVM* javaVM = _shared_library_javavm; if (javaVM == nullptr) { +#ifdef ASSERT const char* val = Arguments::PropertyList_get_value(Arguments::system_properties(), "test.jvmci.forceEnomemOnLibjvmciInit"); if (val != nullptr && strcmp(val, "true") == 0) { *create_JavaVM_err = JNI_ENOMEM; return nullptr; } +#endif char* sl_path; void* sl_handle = JVMCI::get_shared_library(sl_path, true); @@ -2062,12 +2064,14 @@ void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, c JVMCIObject result_object = JVMCIENV->call_HotSpotJVMCIRuntime_compileMethod(receiver, jvmci_method, entry_bci, (jlong) compile_state, compile_state->task()->compile_id()); +#ifdef ASSERT if (JVMCIENV->has_pending_exception()) { const char* val = Arguments::PropertyList_get_value(Arguments::system_properties(), "test.jvmci.compileMethodExceptionIsFatal"); if (val != nullptr && strcmp(val, "true") == 0) { fatal_exception(JVMCIENV, "testing JVMCI fatal exception handling"); } } +#endif if (after_compiler_upcall(JVMCIENV, compiler, method, "call_HotSpotJVMCIRuntime_compileMethod")) { return; diff --git a/src/java.base/share/classes/jdk/internal/vm/TranslatedException.java b/src/java.base/share/classes/jdk/internal/vm/TranslatedException.java index 6907f4fec9d..92a443704e8 100644 --- a/src/java.base/share/classes/jdk/internal/vm/TranslatedException.java +++ b/src/java.base/share/classes/jdk/internal/vm/TranslatedException.java @@ -24,6 +24,8 @@ */ package jdk.internal.vm; +import jdk.internal.misc.VM; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; @@ -56,6 +58,7 @@ final class TranslatedException extends Exception { */ private static final byte[] FALLBACK_ENCODED_THROWABLE_BYTES; static { + maybeFailClinit(); try { FALLBACK_ENCODED_THROWABLE_BYTES = encodeThrowable(new TranslatedException("error during encoding", @@ -67,6 +70,22 @@ final class TranslatedException extends Exception { } } + /** + * Helper to test exception translation. + */ + private static void maybeFailClinit() { + String className = VM.getSavedProperty("test.jvmci.TranslatedException.clinit.throw"); + if (className != null) { + try { + throw (Throwable) Class.forName(className).getDeclaredConstructor().newInstance(); + } catch (RuntimeException | Error e) { + throw e; + } catch (Throwable e) { + throw new InternalError(e); + } + } + } + /** * Class name of exception that could not be instantiated. */ diff --git a/test/hotspot/jtreg/compiler/jvmci/TestUncaughtErrorInCompileMethod.java b/test/hotspot/jtreg/compiler/jvmci/TestUncaughtErrorInCompileMethod.java index 1f337fca942..d0c90bcd6da 100644 --- a/test/hotspot/jtreg/compiler/jvmci/TestUncaughtErrorInCompileMethod.java +++ b/test/hotspot/jtreg/compiler/jvmci/TestUncaughtErrorInCompileMethod.java @@ -24,7 +24,10 @@ /* * @test * @summary Tests handling of an exception thrown by HotSpotJVMCIRuntime.compileMethod. + * Requires a debug VM as it uses test.jvmci.compileMethodExceptionIsFatal + * which is only read in a debug VM. * @requires vm.jvmci + * @requires vm.debug * @library /test/lib / * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot * jdk.internal.vm.ci/jdk.vm.ci.code diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHotSpotJVMCIRuntime.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHotSpotJVMCIRuntime.java index 779ce9c1653..29a3508d877 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHotSpotJVMCIRuntime.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHotSpotJVMCIRuntime.java @@ -32,6 +32,7 @@ * jdk.internal.vm.ci/jdk.vm.ci.common * @library /compiler/jvmci/jdk.vm.ci.hotspot.test/src * /compiler/jvmci/jdk.vm.ci.code.test/src + * @library /test/lib * @run testng/othervm * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler * jdk.vm.ci.hotspot.test.TestHotSpotJVMCIRuntime @@ -53,6 +54,8 @@ import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.test.lib.Platform; + public class TestHotSpotJVMCIRuntime { @Test @@ -157,6 +160,11 @@ public static void main(String[] args) { @Test public void jniEnomemTest() throws Exception { + if (!Platform.isDebugBuild()) { + // The test.jvmci.forceEnomemOnLibjvmciInit property is only + // read in a debug VM. + return; + } String[] names = {"translate", "attachCurrentThread", "registerNativeMethods"}; for (String name : names) { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( From 88b4e3b8539c2beb29ad92bd74b300002c2ef84b Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Thu, 10 Aug 2023 20:02:27 +0000 Subject: [PATCH 017/162] 8304292: Memory leak related to ClassLoader::update_class_path_entry_list Reviewed-by: dholmes, iklam --- src/hotspot/share/classfile/classLoader.cpp | 16 ++++--- src/hotspot/share/classfile/classLoader.hpp | 2 +- .../runtime/cds/appcds/ClassPathAttr.java | 19 ++++++--- .../cds/appcds/DuplicateClassPaths.java | 42 +++++++++++++++++++ .../cds/appcds/test-classes/cpattr_dup.mf | 3 ++ 5 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/DuplicateClassPaths.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/test-classes/cpattr_dup.mf diff --git a/src/hotspot/share/classfile/classLoader.cpp b/src/hotspot/share/classfile/classLoader.cpp index fcbfdeeb9cf..de06f1b94c7 100644 --- a/src/hotspot/share/classfile/classLoader.cpp +++ b/src/hotspot/share/classfile/classLoader.cpp @@ -523,7 +523,8 @@ void ClassLoader::setup_app_search_path(JavaThread* current, const char *class_p while (cp_stream.has_next()) { const char* path = cp_stream.get_next(); - update_class_path_entry_list(current, path, false, false, false); + update_class_path_entry_list(current, path, /* check_for_duplicates */ true, + /* is_boot_append */ false, /* from_class_path_attr */ false); } } @@ -668,7 +669,8 @@ void ClassLoader::setup_bootstrap_search_path_impl(JavaThread* current, const ch } else { // Every entry on the boot class path after the initial base piece, // which is set by os::set_boot_path(), is considered an appended entry. - update_class_path_entry_list(current, path, false, true, false); + update_class_path_entry_list(current, path, /* check_for_duplicates */ false, + /* is_boot_append */ true, /* from_class_path_attr */ false); } } } @@ -803,7 +805,7 @@ void ClassLoader::add_to_boot_append_entries(ClassPathEntry *new_entry) { // Note that at dump time, ClassLoader::_app_classpath_entries are NOT used for // loading app classes. Instead, the app class are loaded by the // jdk/internal/loader/ClassLoaders$AppClassLoader instance. -void ClassLoader::add_to_app_classpath_entries(JavaThread* current, +bool ClassLoader::add_to_app_classpath_entries(JavaThread* current, ClassPathEntry* entry, bool check_for_duplicates) { #if INCLUDE_CDS @@ -813,7 +815,7 @@ void ClassLoader::add_to_app_classpath_entries(JavaThread* current, while (e != nullptr) { if (strcmp(e->name(), entry->name()) == 0) { // entry already exists - return; + return false; } e = e->next(); } @@ -832,6 +834,7 @@ void ClassLoader::add_to_app_classpath_entries(JavaThread* current, ClassLoaderExt::process_jar_manifest(current, entry); } #endif + return true; } // Returns true IFF the file/dir exists and the entry was successfully created. @@ -854,7 +857,10 @@ bool ClassLoader::update_class_path_entry_list(JavaThread* current, if (is_boot_append) { add_to_boot_append_entries(new_entry); } else { - add_to_app_classpath_entries(current, new_entry, check_for_duplicates); + if (!add_to_app_classpath_entries(current, new_entry, check_for_duplicates)) { + // new_entry is not saved, free it now + delete new_entry; + } } return true; } else { diff --git a/src/hotspot/share/classfile/classLoader.hpp b/src/hotspot/share/classfile/classLoader.hpp index 0733a5a347c..5237e05b4b8 100644 --- a/src/hotspot/share/classfile/classLoader.hpp +++ b/src/hotspot/share/classfile/classLoader.hpp @@ -222,7 +222,7 @@ class ClassLoader: AllStatic { CDS_ONLY(static ClassPathEntry* _last_module_path_entry;) CDS_ONLY(static void setup_app_search_path(JavaThread* current, const char* class_path);) CDS_ONLY(static void setup_module_search_path(JavaThread* current, const char* path);) - static void add_to_app_classpath_entries(JavaThread* current, + static bool add_to_app_classpath_entries(JavaThread* current, ClassPathEntry* entry, bool check_for_duplicates); CDS_ONLY(static void add_to_module_path_entries(const char* path, diff --git a/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java b/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java index 5a3bb39b8b9..f0d797c09ae 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java @@ -55,9 +55,10 @@ static void testNormalOps() throws Exception { "CpAttr2", "CpAttr3", "CpAttr4", "CpAttr5"); buildCpAttr("cpattr5_123456789_223456789_323456789_423456789_523456789_623456789", "cpattr5_extra_long.mf", "CpAttr5", "CpAttr5"); + String[] classlist = { "CpAttr1", "CpAttr2", "CpAttr3", "CpAttr4", "CpAttr5"}; + String jar4 = TestCommon.getTestJar("cpattr4.jar"); for (int i=1; i<=2; i++) { String jar1 = TestCommon.getTestJar("cpattr1.jar"); - String jar4 = TestCommon.getTestJar("cpattr4.jar"); if (i == 2) { // Test case #2 -- same as #1, except we use cpattr1_long.jar, which has a super-long // Class-Path: attribute. @@ -65,11 +66,7 @@ static void testNormalOps() throws Exception { } String cp = jar1 + File.pathSeparator + jar4; - TestCommon.testDump(cp, TestCommon.list("CpAttr1", - "CpAttr2", - "CpAttr3", - "CpAttr4", - "CpAttr5")); + TestCommon.testDump(cp, classlist); TestCommon.run( "-cp", cp, @@ -86,6 +83,16 @@ static void testNormalOps() throws Exception { output.shouldMatch("checking shared classpath entry: .*cpattr3.jar"); }); } + + // test duplicate jars in the "Class-path" attribute in the jar manifest + buildCpAttr("cpattr_dup", "cpattr_dup.mf", "CpAttr1", "CpAttr1"); + String cp = TestCommon.getTestJar("cpattr_dup.jar") + File.pathSeparator + jar4; + TestCommon.testDump(cp, classlist); + + TestCommon.run( + "-cp", cp, + "CpAttr1") + .assertNormalExit(); } static void testNonExistentJars() throws Exception { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/DuplicateClassPaths.java b/test/hotspot/jtreg/runtime/cds/appcds/DuplicateClassPaths.java new file mode 100644 index 00000000000..ce0e1804997 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/DuplicateClassPaths.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @summary duplicate class paths test + * @requires vm.cds + * @library /test/lib + * @compile test-classes/Hello.java + * @run driver DuplicateClassPaths + */ + +import java.io.File; + +public class DuplicateClassPaths { + public static void main(String[] args) throws Exception { + String appJar = JarBuilder.getOrCreateHelloJar(); + String jars = appJar + File.pathSeparator + appJar; + TestCommon.test(jars, TestCommon.list("Hello"), "Hello"); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/cpattr_dup.mf b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/cpattr_dup.mf new file mode 100644 index 00000000000..ad1f974d82d --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/cpattr_dup.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: cpattr2.jar cpattr2.jar +Created-By: 1.9.0-internal (Oracle Corporation) From 42758cb889a5cf1d7f4c4b468a383b218baa1b27 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 10 Aug 2023 22:26:32 +0000 Subject: [PATCH 018/162] 8312882: Update the CONTRIBUTING.md with pointers to lifecycle of a PR Reviewed-by: erikj, jwilhelm --- CONTRIBUTING.md | 2 +- doc/building.html | 19 +++++-------------- doc/building.md | 15 +-------------- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 990ed2b79ac..4a338235c1d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing to the JDK -Please see for how to contribute. +Please see the [OpenJDK Developersโ€™ Guide](https://openjdk.org/guide/). diff --git a/doc/building.html b/doc/building.html index 54828da9991..c88d87f288b 100644 --- a/doc/building.html +++ b/doc/building.html @@ -324,7 +324,8 @@

Building on x86

Even for 32-bit builds, it is recommended to use a 64-bit build machine, and instead create a 32-bit target using --with-target-bits=32.

-

Note: The Windows 32-bit x86 port is deprecated and may be removed in a future release.

+

Note: The Windows 32-bit x86 port is deprecated and may be removed in +a future release.

Building on aarch64

At a minimum, a machine with 8 cores is advisable, as well as 8 GB of RAM. (The more cores to use, the more memory you need.) At least 6 GB of @@ -401,7 +402,8 @@

Windows

use --with-msvcr-dll=/cygdrive/c/msvcr100.dll rather than --with-msvcr-dll=c:\msvcr100.dll. For details on this conversion, see the section on Fixpath.

-

Note: The Windows 32-bit x86 port is deprecated and may be removed in a future release.

+

Note: The Windows 32-bit x86 port is deprecated and may be removed in +a future release.

Cygwin

A functioning Cygwin environment is required for building the JDK on Windows. If you have a 64-bit OS, we @@ -2255,18 +2257,7 @@

Contributing to the JDK

must ask you to follow our rules and guidelines to be able to accept your contribution.

The official place to start is the 'How to contribute' page. -There is also an official (but somewhat outdated and skimpy on details) -Developer's Guide.

-

If this seems overwhelming to you, the Adoption Group is there to -help you! A good place to start is their 'New -Contributor' page, or start reading the comprehensive Getting -Started Kit. The Adoption Group will also happily answer any -questions you have about contributing. Contact them by mail -or IRC.

+href="https://openjdk.org/guide/">OpenJDK Developersโ€™ Guide.

Editing this document

If you want to contribute changes to this document, edit doc/building.md and then run diff --git a/doc/building.md b/doc/building.md index d6d89d7887f..e2504d12b4a 100644 --- a/doc/building.md +++ b/doc/building.md @@ -2032,20 +2032,7 @@ First of all: Thank you! We gladly welcome your contribution. However, please bear in mind that the JDK is a massive project, and we must ask you to follow our rules and guidelines to be able to accept your contribution. -The official place to start is the ['How to contribute' page]( -http://openjdk.org/contribute/). There is also an official (but somewhat -outdated and skimpy on details) [Developer's Guide]( -http://openjdk.org/guide/). - -If this seems overwhelming to you, the Adoption Group is there to help you! A -good place to start is their ['New Contributor' page]( -https://wiki.openjdk.org/display/Adoption/New+Contributor), or start -reading the comprehensive [Getting Started Kit]( -https://adoptopenjdk.gitbooks.io/adoptopenjdk-getting-started-kit/en/). The -Adoption Group will also happily answer any questions you have about -contributing. Contact them by [mail]( -http://mail.openjdk.org/mailman/listinfo/adoption-discuss) or [IRC]( -http://openjdk.org/irc/). +The official place to start is the [OpenJDK Developersโ€™ Guide](https://openjdk.org/guide/). ## Editing this document From 9abb2a559e4f809f07db1b747660f68b9d943e3b Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Thu, 10 Aug 2023 23:43:38 +0000 Subject: [PATCH 019/162] 8312461: JNI warnings in SunMSCApi provider Reviewed-by: valeriep, djelinski --- .../windows/native/libsunmscapi/security.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp index e2b3b9652fd..4633151caa9 100644 --- a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp +++ b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -639,6 +639,7 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_loadKeysOrCertificateC // Generate certificate from byte array and store into // cert collection env->CallVoidMethod(obj, mGenCert, byteArray, jArrayList); + JNU_CHECK_EXCEPTION(env); } // Usually pszNameString should be non-NULL. It's either @@ -659,6 +660,7 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_loadKeysOrCertificateC env->CallVoidMethod(obj, mGenCertChain, name, jArrayList); + JNU_CHECK_EXCEPTION(env); } else { @@ -681,6 +683,7 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_loadKeysOrCertificateC name, (jlong) hCryptProv, (jlong) hUserKey, dwPublicKeyLength, jArrayList); + JNU_CHECK_EXCEPTION(env); } } else { // Only accept EC for CNG @@ -702,6 +705,7 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_loadKeysOrCertificateC name, (jlong) hCryptProv, (jlong) 0, dwPublicKeyLength, jArrayList); + JNU_CHECK_EXCEPTION(env); } else if (buffer[0] == 'R' && buffer[2] == 'S' && buffer[4] == 'A') { env->CallVoidMethod(obj, mGenKeyAndCertChain, @@ -709,6 +713,7 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_loadKeysOrCertificateC name, (jlong) hCryptProv, (jlong) 0, dwPublicKeyLength, jArrayList); + JNU_CHECK_EXCEPTION(env); } else { dump("Unknown NCRYPT_ALGORITHM_PROPERTY", buffer, len); } From 43462a36ab02b67d426c04d345868bd420b30c25 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Fri, 11 Aug 2023 03:39:39 +0000 Subject: [PATCH 020/162] 8313224: Avoid calling JavaThread::current() in MemAllocator::Allocation constructor Reviewed-by: tschatzl, coleenp --- src/hotspot/share/gc/shared/memAllocator.cpp | 21 ++++++++++---------- src/hotspot/share/gc/shared/memAllocator.hpp | 6 ++++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/hotspot/share/gc/shared/memAllocator.cpp b/src/hotspot/share/gc/shared/memAllocator.cpp index ed54128d34a..e4b91413537 100644 --- a/src/hotspot/share/gc/shared/memAllocator.cpp +++ b/src/hotspot/share/gc/shared/memAllocator.cpp @@ -56,11 +56,11 @@ class MemAllocator::Allocation: StackObj { bool check_out_of_memory(); void verify_before(); void verify_after(); - void notify_allocation(JavaThread* thread); + void notify_allocation(); void notify_allocation_jvmti_sampler(); void notify_allocation_low_memory_detector(); void notify_allocation_jfr_sampler(); - void notify_allocation_dtrace_sampler(JavaThread* thread); + void notify_allocation_dtrace_sampler(); #ifdef ASSERT void check_for_valid_allocation_state() const; #endif @@ -70,19 +70,20 @@ class MemAllocator::Allocation: StackObj { public: Allocation(const MemAllocator& allocator, oop* obj_ptr) : _allocator(allocator), - _thread(JavaThread::current()), + _thread(JavaThread::cast(allocator._thread)), // Do not use Allocation in non-JavaThreads. _obj_ptr(obj_ptr), _overhead_limit_exceeded(false), _allocated_outside_tlab(false), _allocated_tlab_size(0), _tlab_end_reset_for_sample(false) { + assert(Thread::current() == allocator._thread, "do not pass MemAllocator across threads"); verify_before(); } ~Allocation() { if (!check_out_of_memory()) { - notify_allocation(_thread); + notify_allocation(); } } @@ -156,7 +157,7 @@ void MemAllocator::Allocation::check_for_valid_allocation_state() const { assert(!_thread->has_pending_exception(), "shouldn't be allocating with pending exception"); // Allocation of an oop can always invoke a safepoint. - JavaThread::cast(_thread)->check_for_valid_safepoint_state(); + _thread->check_for_valid_safepoint_state(); } #endif @@ -217,21 +218,21 @@ void MemAllocator::Allocation::notify_allocation_jfr_sampler() { } } -void MemAllocator::Allocation::notify_allocation_dtrace_sampler(JavaThread* thread) { +void MemAllocator::Allocation::notify_allocation_dtrace_sampler() { if (DTraceAllocProbes) { // support for Dtrace object alloc event (no-op most of the time) Klass* klass = obj()->klass(); size_t word_size = _allocator._word_size; if (klass != nullptr && klass->name() != nullptr) { - SharedRuntime::dtrace_object_alloc(thread, obj(), word_size); + SharedRuntime::dtrace_object_alloc(_thread, obj(), word_size); } } } -void MemAllocator::Allocation::notify_allocation(JavaThread* thread) { +void MemAllocator::Allocation::notify_allocation() { notify_allocation_low_memory_detector(); notify_allocation_jfr_sampler(); - notify_allocation_dtrace_sampler(thread); + notify_allocation_dtrace_sampler(); notify_allocation_jvmti_sampler(); } @@ -335,7 +336,7 @@ HeapWord* MemAllocator::mem_allocate_inside_tlab_slow(Allocation& allocation) co HeapWord* MemAllocator::mem_allocate_slow(Allocation& allocation) const { // Allocation of an oop can always invoke a safepoint. - debug_only(JavaThread::cast(_thread)->check_for_valid_safepoint_state()); + debug_only(allocation._thread->check_for_valid_safepoint_state()); if (UseTLAB) { // Try refilling the TLAB and allocating the object in it. diff --git a/src/hotspot/share/gc/shared/memAllocator.hpp b/src/hotspot/share/gc/shared/memAllocator.hpp index 48faded1337..93ed10dce05 100644 --- a/src/hotspot/share/gc/shared/memAllocator.hpp +++ b/src/hotspot/share/gc/shared/memAllocator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,9 @@ class MemAllocator: StackObj { : _thread(thread), _klass(klass), _word_size(word_size) - { } + { + assert(_thread == Thread::current(), "must be"); + } // Initialization provided by subclasses. virtual oop initialize(HeapWord* mem) const = 0; From 62adeb08c34ea199d19cf98c7f03e937d8cfa9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Sj=C3=B6len?= Date: Fri, 11 Aug 2023 09:32:45 +0000 Subject: [PATCH 021/162] 8311648: Refactor the Arena/Chunk/ChunkPool interface Reviewed-by: stuefe, coleenp --- src/hotspot/share/memory/arena.cpp | 161 +++++++++++----------- src/hotspot/share/memory/arena.hpp | 31 +++-- src/hotspot/share/memory/resourceArea.hpp | 2 +- src/hotspot/share/runtime/handles.cpp | 2 +- src/hotspot/share/runtime/threads.cpp | 2 +- 5 files changed, 100 insertions(+), 98 deletions(-) diff --git a/src/hotspot/share/memory/arena.cpp b/src/hotspot/share/memory/arena.cpp index 06c79df4955..ac16279ab71 100644 --- a/src/hotspot/share/memory/arena.cpp +++ b/src/hotspot/share/memory/arena.cpp @@ -26,6 +26,7 @@ #include "precompiled.hpp" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" +#include "memory/arena.hpp" #include "memory/resourceArea.hpp" #include "runtime/os.hpp" #include "runtime/task.hpp" @@ -43,24 +44,18 @@ STATIC_ASSERT(is_aligned((int)Chunk::medium_size, ARENA_AMALLOC_ALIGNMENT)); STATIC_ASSERT(is_aligned((int)Chunk::size, ARENA_AMALLOC_ALIGNMENT)); STATIC_ASSERT(is_aligned((int)Chunk::non_pool_size, ARENA_AMALLOC_ALIGNMENT)); -//-------------------------------------------------------------------------------------- -// ChunkPool implementation - // MT-safe pool of same-sized chunks to reduce malloc/free thrashing // NB: not using Mutex because pools are used before Threads are initialized class ChunkPool { - Chunk* _first; // first cached Chunk; its first word points to next chunk - const size_t _size; // (inner payload) size of the chunks this pool serves - // Our four static pools - static const int _num_pools = 4; + static constexpr int _num_pools = 4; static ChunkPool _pools[_num_pools]; - public: - ChunkPool(size_t size) : _first(nullptr), _size(size) {} + Chunk* _first; + const size_t _size; // (inner payload) size of the chunks this pool serves - // Allocate a chunk from the pool; returns null if pool is empty. - Chunk* allocate() { + // Returns null if pool is empty. + Chunk* take_from_pool() { ThreadCritical tc; Chunk* c = _first; if (_first != nullptr) { @@ -68,16 +63,14 @@ class ChunkPool { } return c; } - - // Return a chunk to the pool - void free(Chunk* chunk) { + void return_to_pool(Chunk* chunk) { assert(chunk->length() == _size, "wrong pool for this chunk"); ThreadCritical tc; chunk->set_next(_first); _first = chunk; } - // Prune the pool + // Clear this pool of all contained chunks void prune() { // Free all chunks while in ThreadCritical lock // so NMT adjustment is stable. @@ -92,13 +85,6 @@ class ChunkPool { _first = nullptr; } - static void clean() { - NativeHeapTrimmer::SuspendMark sm("chunk pool cleaner"); - for (int i = 0; i < _num_pools; i++) { - _pools[i].prune(); - } - } - // Given a (inner payload) size, return the pool responsible for it, or null if the size is non-standard static ChunkPool* get_pool_for_size(size_t size) { for (int i = 0; i < _num_pools; i++) { @@ -109,28 +95,22 @@ class ChunkPool { return nullptr; } -}; - -ChunkPool ChunkPool::_pools[] = { Chunk::size, Chunk::medium_size, Chunk::init_size, Chunk::tiny_size }; - -//-------------------------------------------------------------------------------------- -// ChunkPoolCleaner implementation -// +public: + ChunkPool(size_t size) : _first(nullptr), _size(size) {} -class ChunkPoolCleaner : public PeriodicTask { - static const int cleaning_interval = 5000; // cleaning interval in ms + static void clean() { + NativeHeapTrimmer::SuspendMark sm("chunk pool cleaner"); + for (int i = 0; i < _num_pools; i++) { + _pools[i].prune(); + } + } - public: - ChunkPoolCleaner() : PeriodicTask(cleaning_interval) {} - void task() { - ChunkPool::clean(); - } + // Returns an initialized and null-terminated Chunk of requested size + static Chunk* allocate_chunk(size_t length, AllocFailType alloc_failmode); + static void deallocate_chunk(Chunk* p); }; -//-------------------------------------------------------------------------------------- -// Chunk implementation - -void* Chunk::operator new (size_t sizeofChunk, AllocFailType alloc_failmode, size_t length) throw() { +Chunk* ChunkPool::allocate_chunk(size_t length, AllocFailType alloc_failmode) { // - requested_size = sizeof(Chunk) // - length = payload size // We must ensure that the boundaries of the payload (C and D) are aligned to 64-bit: @@ -149,62 +129,57 @@ void* Chunk::operator new (size_t sizeofChunk, AllocFailType alloc_failmode, siz // - the payload size (length) must be aligned to 64-bit, which takes care of 64-bit // aligning (D) - assert(sizeofChunk == sizeof(Chunk), "weird request size"); assert(is_aligned(length, ARENA_AMALLOC_ALIGNMENT), "chunk payload length misaligned: " SIZE_FORMAT ".", length); // Try to reuse a freed chunk from the pool ChunkPool* pool = ChunkPool::get_pool_for_size(length); + Chunk* chunk = nullptr; if (pool != nullptr) { - Chunk* c = pool->allocate(); + Chunk* c = pool->take_from_pool(); if (c != nullptr) { assert(c->length() == length, "wrong length?"); - return c; + chunk = c; } } - // Either the pool was empty, or this is a non-standard length. Allocate a new Chunk from C-heap. - size_t bytes = ARENA_ALIGN(sizeofChunk) + length; - void* p = os::malloc(bytes, mtChunk, CALLER_PC); - if (p == nullptr && alloc_failmode == AllocFailStrategy::EXIT_OOM) { - vm_exit_out_of_memory(bytes, OOM_MALLOC_ERROR, "Chunk::new"); + if (chunk == nullptr) { + // Either the pool was empty, or this is a non-standard length. Allocate a new Chunk from C-heap. + size_t bytes = ARENA_ALIGN(sizeof(Chunk)) + length; + void* p = os::malloc(bytes, mtChunk, CALLER_PC); + if (p == nullptr && alloc_failmode == AllocFailStrategy::EXIT_OOM) { + vm_exit_out_of_memory(bytes, OOM_MALLOC_ERROR, "Chunk::new"); + } + chunk = (Chunk*)p; } + ::new(chunk) Chunk(length); // We rely on arena alignment <= malloc alignment. - assert(is_aligned(p, ARENA_AMALLOC_ALIGNMENT), "Chunk start address misaligned."); - return p; + assert(is_aligned(chunk, ARENA_AMALLOC_ALIGNMENT), "Chunk start address misaligned."); + return chunk; } -void Chunk::operator delete(void* p) { +void ChunkPool::deallocate_chunk(Chunk* c) { // If this is a standard-sized chunk, return it to its pool; otherwise free it. - Chunk* c = (Chunk*)p; ChunkPool* pool = ChunkPool::get_pool_for_size(c->length()); if (pool != nullptr) { - pool->free(c); + pool->return_to_pool(c); } else { ThreadCritical tc; // Free chunks under TC lock so that NMT adjustment is stable. os::free(c); } } -Chunk::Chunk(size_t length) : _len(length) { - _next = nullptr; // Chain on the linked list -} +ChunkPool ChunkPool::_pools[] = { Chunk::size, Chunk::medium_size, Chunk::init_size, Chunk::tiny_size }; -void Chunk::chop() { - Chunk *k = this; - while( k ) { - Chunk *tmp = k->next(); - // clear out this chunk (to detect allocation bugs) - if (ZapResourceArea) memset(k->bottom(), badResourceValue, k->length()); - delete k; // Free chunk (was malloc'd) - k = tmp; - } -} +class ChunkPoolCleaner : public PeriodicTask { + static const int cleaning_interval = 5000; // cleaning interval in ms -void Chunk::next_chop() { - _next->chop(); - _next = nullptr; -} + public: + ChunkPoolCleaner() : PeriodicTask(cleaning_interval) {} + void task() { + ChunkPool::clean(); + } +}; -void Chunk::start_chunk_pool_cleaner_task() { +void Arena::start_chunk_pool_cleaner_task() { #ifdef ASSERT static bool task_created = false; assert(!task_created, "should not start chuck pool cleaner twice"); @@ -214,11 +189,30 @@ void Chunk::start_chunk_pool_cleaner_task() { cleaner->enroll(); } -//------------------------------Arena------------------------------------------ +Chunk::Chunk(size_t length) : _len(length) { + _next = nullptr; // Chain on the linked list +} + +void Chunk::chop(Chunk* k) { + while (k != nullptr) { + Chunk* tmp = k->next(); + // clear out this chunk (to detect allocation bugs) + if (ZapResourceArea) memset(k->bottom(), badResourceValue, k->length()); + ChunkPool::deallocate_chunk(k); + k = tmp; + } +} + +void Chunk::next_chop(Chunk* k) { + assert(k != nullptr && k->_next != nullptr, "must be non-null"); + Chunk::chop(k->_next); + k->_next = nullptr; +} Arena::Arena(MEMFLAGS flag, size_t init_size) : _flags(flag), _size_in_bytes(0) { init_size = ARENA_ALIGN(init_size); - _first = _chunk = new (AllocFailStrategy::EXIT_OOM, init_size) Chunk(init_size); + _chunk = ChunkPool::allocate_chunk(init_size, AllocFailStrategy::EXIT_OOM); + _first = _chunk; _hwm = _chunk->bottom(); // Save the cached hwm, max _max = _chunk->top(); MemTracker::record_new_arena(flag); @@ -226,7 +220,8 @@ Arena::Arena(MEMFLAGS flag, size_t init_size) : _flags(flag), _size_in_bytes(0) } Arena::Arena(MEMFLAGS flag) : _flags(flag), _size_in_bytes(0) { - _first = _chunk = new (AllocFailStrategy::EXIT_OOM, Chunk::init_size) Chunk(Chunk::init_size); + _chunk = ChunkPool::allocate_chunk(Chunk::init_size, AllocFailStrategy::EXIT_OOM); + _first = _chunk; _hwm = _chunk->bottom(); // Save the cached hwm, max _max = _chunk->top(); MemTracker::record_new_arena(flag); @@ -244,7 +239,7 @@ void Arena::destruct_contents() { // that can have total arena memory exceed total chunk memory set_size_in_bytes(0); if (_first != nullptr) { - _first->chop(); + Chunk::chop(_first); } reset(); } @@ -262,7 +257,7 @@ void Arena::set_size_in_bytes(size_t size) { // Total of all Chunks in arena size_t Arena::used() const { size_t sum = _chunk->length() - (_max-_hwm); // Size leftover in this Chunk - Chunk *k = _first; + Chunk* k = _first; while( k != _chunk) { // Whilst have Chunks in a row sum += k->length(); // Total size of this Chunk k = k->next(); // Bump along to next Chunk @@ -280,15 +275,19 @@ void* Arena::grow(size_t x, AllocFailType alloc_failmode) { return nullptr; } - Chunk *k = _chunk; // Get filled-up chunk address - _chunk = new (alloc_failmode, len) Chunk(len); + Chunk* k = _chunk; // Get filled-up chunk address + _chunk = ChunkPool::allocate_chunk(len, alloc_failmode); if (_chunk == nullptr) { _chunk = k; // restore the previous value of _chunk return nullptr; } - if (k) k->set_next(_chunk); // Append new chunk to end of linked list - else _first = _chunk; + + if (k != nullptr) { + k->set_next(_chunk); // Append new chunk to end of linked list + } else { + _first = _chunk; + } _hwm = _chunk->bottom(); // Save the cached hwm, max _max = _chunk->top(); set_size_in_bytes(size_in_bytes() + len); @@ -343,7 +342,7 @@ bool Arena::contains( const void *ptr ) const { if (_chunk == nullptr) return false; if( (void*)_chunk->bottom() <= ptr && ptr < (void*)_hwm ) return true; // Check for in this chunk - for (Chunk *c = _first; c; c = c->next()) { + for (Chunk* c = _first; c; c = c->next()) { if (c == _chunk) continue; // current chunk has been processed if ((void*)c->bottom() <= ptr && ptr < (void*)c->top()) { return true; // Check for every chunk in Arena diff --git a/src/hotspot/share/memory/arena.hpp b/src/hotspot/share/memory/arena.hpp index 2799a144cff..ad142e189ac 100644 --- a/src/hotspot/share/memory/arena.hpp +++ b/src/hotspot/share/memory/arena.hpp @@ -37,16 +37,19 @@ #define ARENA_AMALLOC_ALIGNMENT BytesPerLong #define ARENA_ALIGN(x) (align_up((x), ARENA_AMALLOC_ALIGNMENT)) -//------------------------------Chunk------------------------------------------ + // Linked list of raw memory chunks -class Chunk: CHeapObj { +class Chunk { private: Chunk* _next; // Next Chunk in list const size_t _len; // Size of this Chunk - public: - void* operator new(size_t size, AllocFailType alloc_failmode, size_t length) throw(); - void operator delete(void* p); +public: + NONCOPYABLE(Chunk); + + void operator delete(void*) = delete; + void* operator new(size_t) = delete; + Chunk(size_t length); enum { @@ -67,8 +70,8 @@ class Chunk: CHeapObj { non_pool_size = init_size + 32 // An initial size which is not one of above }; - void chop(); // Chop this chunk - void next_chop(); // Chop next chunk + static void chop(Chunk* chunk); // Chop this chunk + static void next_chop(Chunk* chunk); // Chop next chunk static size_t aligned_overhead_size(void) { return ARENA_ALIGN(sizeof(Chunk)); } static size_t aligned_overhead_size(size_t byte_size) { return ARENA_ALIGN(byte_size); } @@ -79,12 +82,8 @@ class Chunk: CHeapObj { char* bottom() const { return ((char*) this) + aligned_overhead_size(); } char* top() const { return bottom() + _len; } bool contains(char* p) const { return bottom() <= p && p <= top(); } - - // Start the chunk_pool cleaner task - static void start_chunk_pool_cleaner_task(); }; -//------------------------------Arena------------------------------------------ // Fast allocation of memory class Arena : public CHeapObjBase { protected: @@ -94,9 +93,10 @@ class Arena : public CHeapObjBase { MEMFLAGS _flags; // Memory tracking flags - Chunk *_first; // First chunk - Chunk *_chunk; // current chunk - char *_hwm, *_max; // High water mark and max in current chunk + Chunk* _first; // First chunk + Chunk* _chunk; // current chunk + char* _hwm; // High water mark + char* _max; // and max in current chunk // Get a new Chunk of at least size x void* grow(size_t x, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM); size_t _size_in_bytes; // Size of arena (used for native memory tracking) @@ -113,6 +113,9 @@ class Arena : public CHeapObjBase { } public: + // Start the chunk_pool cleaner task + static void start_chunk_pool_cleaner_task(); + Arena(MEMFLAGS memflag); Arena(MEMFLAGS memflag, size_t init_size); ~Arena(); diff --git a/src/hotspot/share/memory/resourceArea.hpp b/src/hotspot/share/memory/resourceArea.hpp index a10e3105c6b..b81209a62d1 100644 --- a/src/hotspot/share/memory/resourceArea.hpp +++ b/src/hotspot/share/memory/resourceArea.hpp @@ -112,7 +112,7 @@ class ResourceArea: public Arena { "size: " SIZE_FORMAT ", saved size: " SIZE_FORMAT, size_in_bytes(), state._size_in_bytes); set_size_in_bytes(state._size_in_bytes); - state._chunk->next_chop(); + Chunk::next_chop(state._chunk); assert(_hwm != state._hwm, "Sanity check: HWM moves when we have later chunks"); } else { assert(size_in_bytes() == state._size_in_bytes, "Sanity check"); diff --git a/src/hotspot/share/runtime/handles.cpp b/src/hotspot/share/runtime/handles.cpp index bef4736e443..222dcaeeaa4 100644 --- a/src/hotspot/share/runtime/handles.cpp +++ b/src/hotspot/share/runtime/handles.cpp @@ -162,7 +162,7 @@ void HandleMark::chop_later_chunks() { // reset arena size before delete chunks. Otherwise, the total // arena size could exceed total chunk size _area->set_size_in_bytes(size_in_bytes()); - _chunk->next_chop(); + Chunk::next_chop(_chunk); } void* HandleMark::operator new(size_t size) throw() { diff --git a/src/hotspot/share/runtime/threads.cpp b/src/hotspot/share/runtime/threads.cpp index 73495c075fd..23c1562255a 100644 --- a/src/hotspot/share/runtime/threads.cpp +++ b/src/hotspot/share/runtime/threads.cpp @@ -680,7 +680,7 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { JvmtiAgentList::load_xrun_agents(); } - Chunk::start_chunk_pool_cleaner_task(); + Arena::start_chunk_pool_cleaner_task(); // Start the service thread // The service thread enqueues JVMTI deferred events and does various hashtable From 6ffc0324dc854c147ab92e5a597d10ed0166b34a Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Fri, 11 Aug 2023 12:19:39 +0000 Subject: [PATCH 022/162] 8314113: G1: Remove unused G1CardSetInlinePtr::card_at Reviewed-by: tschatzl --- src/hotspot/share/gc/g1/g1CardSetContainers.hpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp index 6b23f074ed6..3d9ac2180b5 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp @@ -84,12 +84,6 @@ class G1CardSetInlinePtr : public StackObj { static ContainerPtr merge(ContainerPtr orig_value, uint card_in_region, uint idx, uint bits_per_card); - static uint card_at(ContainerPtr value, uint const idx, uint const bits_per_card) { - uint8_t card_pos = card_pos_for(idx, bits_per_card); - uint result = ((uintptr_t)value >> card_pos) & (((uintptr_t)1 << bits_per_card) - 1); - return result; - } - uint find(uint const card_idx, uint const bits_per_card, uint start_at, uint num_cards); public: From 12326770dc4116dd3b374c3a50fabfa1f27249dd Mon Sep 17 00:00:00 2001 From: Andreas Steiner Date: Fri, 11 Aug 2023 13:21:46 +0000 Subject: [PATCH 023/162] 8313244: NM flags handling in configure process Reviewed-by: clanger, jwaters, mbaesken, erikj --- make/autoconf/flags-other.m4 | 10 ++++++++++ make/autoconf/flags.m4 | 1 + make/autoconf/spec.gmk.in | 1 + make/common/NativeCompilation.gmk | 4 ++-- make/hotspot/lib/CompileJvm.gmk | 10 ++-------- make/hotspot/lib/JvmMapfile.gmk | 6 +++--- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/make/autoconf/flags-other.m4 b/make/autoconf/flags-other.m4 index 8062a32601f..0af7c02cff6 100644 --- a/make/autoconf/flags-other.m4 +++ b/make/autoconf/flags-other.m4 @@ -88,6 +88,16 @@ AC_DEFUN([FLAGS_SETUP_RCFLAGS], AC_SUBST(RCFLAGS) ]) +AC_DEFUN([FLAGS_SETUP_NMFLAGS], +[ + # On AIX, we need to set NM flag -X64 for processing 64bit object files + if test "x$OPENJDK_TARGET_OS" = xaix; then + NMFLAGS="-X64" + fi + + AC_SUBST(NMFLAGS) +]) + ################################################################################ # platform independent AC_DEFUN([FLAGS_SETUP_ASFLAGS], diff --git a/make/autoconf/flags.m4 b/make/autoconf/flags.m4 index f56fbc9b1c4..04bee0c9969 100644 --- a/make/autoconf/flags.m4 +++ b/make/autoconf/flags.m4 @@ -429,6 +429,7 @@ AC_DEFUN([FLAGS_SETUP_FLAGS], FLAGS_SETUP_ARFLAGS FLAGS_SETUP_STRIPFLAGS FLAGS_SETUP_RCFLAGS + FLAGS_SETUP_NMFLAGS FLAGS_SETUP_ASFLAGS FLAGS_SETUP_ASFLAGS_CPU_DEP([TARGET]) diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index d147eb5a251..1c472b5ed68 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -606,6 +606,7 @@ AR := @AR@ ARFLAGS:=@ARFLAGS@ NM:=@NM@ +NMFLAGS:=@NMFLAGS@ STRIP:=@STRIP@ OBJDUMP:=@OBJDUMP@ CXXFILT:=@CXXFILT@ diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index 9fb71dc2a79..8609fc4ca00 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -48,12 +48,12 @@ define GetSymbols $(SED) -e 's/#.*//;s/global://;s/local://;s/\;//;s/^[ ]*/_/;/^_$$$$/d' | \ $(EGREP) -v "JNI_OnLoad|JNI_OnUnload|Agent_OnLoad|Agent_OnUnload|Agent_OnAttach" > \ $$(@D)/$$(basename $$(@F)).symbols || true; \ - $(NM) $$($1_TARGET) | $(GREP) " T " | \ + $(NM) $(NMFLAGS) $$($1_TARGET) | $(GREP) " T " | \ $(EGREP) "JNI_OnLoad|JNI_OnUnload|Agent_OnLoad|Agent_OnUnload|Agent_OnAttach" | \ $(CUT) -d ' ' -f 3 >> $$(@D)/$$(basename $$(@F)).symbols || true;\ else \ $(ECHO) "Getting symbols from nm"; \ - $(NM) -m $$($1_TARGET) | $(GREP) "__TEXT" | \ + $(NM) $(NMFLAGS) -m $$($1_TARGET) | $(GREP) "__TEXT" | \ $(EGREP) -v "non-external|private extern|__TEXT,__eh_frame" | \ $(SED) -e 's/.* //' > $$(@D)/$$(basename $$(@F)).symbols; \ fi diff --git a/make/hotspot/lib/CompileJvm.gmk b/make/hotspot/lib/CompileJvm.gmk index da81b2ca5be..0123829afee 100644 --- a/make/hotspot/lib/CompileJvm.gmk +++ b/make/hotspot/lib/CompileJvm.gmk @@ -281,19 +281,13 @@ ifneq ($(GENERATE_COMPILE_COMMANDS_ONLY), true) # UNDEF_PATTERN := ' U ' - # 'nm' on AIX needs -X64 option - - ifeq ($(call isTargetOs, aix), true) - NM := $(NM) -X64 - endif - define SetupOperatorNewDeleteCheck $1.op_check: $1 $$(call ExecuteWithLog, $1.op_check, \ - $$(NM) $$< 2>&1 | $$(GREP) $$(addprefix -e , $$(MANGLED_SYMS)) | $$(GREP) $$(UNDEF_PATTERN) > $1.op_check || true) + $$(NM) $$(NMFLAGS) $$< 2>&1 | $$(GREP) $$(addprefix -e , $$(MANGLED_SYMS)) | $$(GREP) $$(UNDEF_PATTERN) > $1.op_check || true) if [ -s $1.op_check ]; then \ $$(ECHO) "$$(notdir $$<): Error: Use of global operators new and delete is not allowed in Hotspot:"; \ - $$(NM) $$< | $$(CXXFILT) | $$(EGREP) '$$(DEMANGLED_REGEXP)' | $$(GREP) $$(UNDEF_PATTERN); \ + $$(NM) $$(NMFLAGS) $$< | $$(CXXFILT) | $$(EGREP) '$$(DEMANGLED_REGEXP)' | $$(GREP) $$(UNDEF_PATTERN); \ $$(ECHO) "See: $$(TOPDIR)/make/hotspot/lib/CompileJvm.gmk"; \ exit 1; \ fi diff --git a/make/hotspot/lib/JvmMapfile.gmk b/make/hotspot/lib/JvmMapfile.gmk index d80b804a2f6..2808ac2af03 100644 --- a/make/hotspot/lib/JvmMapfile.gmk +++ b/make/hotspot/lib/JvmMapfile.gmk @@ -53,7 +53,7 @@ endif # platform dependent. ifeq ($(call isTargetOs, linux), true) - DUMP_SYMBOLS_CMD := $(NM) --defined-only *$(OBJ_SUFFIX) + DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) --defined-only *$(OBJ_SUFFIX) ifneq ($(FILTER_SYMBOLS_PATTERN), ) FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)| endif @@ -67,7 +67,7 @@ ifeq ($(call isTargetOs, linux), true) else ifeq ($(call isTargetOs, macosx), true) # nm on macosx prints out "warning: nm: no name list" to stderr for # files without symbols. Hide this, even at the expense of hiding real errors. - DUMP_SYMBOLS_CMD := $(NM) -Uj *$(OBJ_SUFFIX) 2> /dev/null + DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) -Uj *$(OBJ_SUFFIX) 2> /dev/null ifneq ($(FILTER_SYMBOLS_PATTERN), ) FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)| endif @@ -89,7 +89,7 @@ else ifeq ($(call isTargetOs, aix), true) # which may be installed under /opt/freeware/bin. So better use an absolute path here! # NM=/usr/bin/nm - DUMP_SYMBOLS_CMD := $(NM) -X64 -B -C *$(OBJ_SUFFIX) + DUMP_SYMBOLS_CMD := $(NM) $(NMFLAGS) -B -C *$(OBJ_SUFFIX) FILTER_SYMBOLS_AWK_SCRIPT := \ '{ \ if (($$2="d" || $$2="D") && ($$3 ~ /^__vft/ || $$3 ~ /^gHotSpotVM/)) print $$3; \ From 8f1c134848437d7e37fb3b4bd603b91798e19724 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Fri, 11 Aug 2023 18:09:44 +0000 Subject: [PATCH 024/162] 8313798: [aarch64] sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java sometimes times out on aarch64 Reviewed-by: kevinw, sspitsyn --- .../classes/sun/jvm/hotspot/runtime/VFrame.java | 12 +++++++++++- test/jdk/ProblemList.txt | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java index f4d7827254c..83b38654d9b 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ import java.io.*; import sun.jvm.hotspot.code.*; import sun.jvm.hotspot.utilities.*; +import sun.jvm.hotspot.debugger.Address; public class VFrame { protected Frame fr; @@ -145,7 +146,16 @@ public JavaVFrame javaSender() { if (f.isJavaFrame()) { return (JavaVFrame) f; } + Address oldSP = f.getFrame().getSP(); f = f.sender(imprecise); + if (f != null) { + // Make sure the sender frame is above the current frame, not below + Address newSP = f.getFrame().getSP(); + if (oldSP.greaterThanOrEqual(newSP)) { + String errString = "newSP(" + newSP + ") is not above oldSP(" + oldSP + ")"; + throw new RuntimeException(errString); + } + } } return null; } diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 0db84d6274f..3b266fee462 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -734,7 +734,6 @@ sun/tools/jstat/jstatLineCounts3.sh 8268211 linux-aa sun/tools/jstat/jstatLineCounts4.sh 8268211 linux-aarch64 sun/tools/jhsdb/JStackStressTest.java 8276210 linux-aarch64 -sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8313798 generic-aarch64 ############################################################################ From 733250288325bc663afc0376342d4c5a7a471cbd Mon Sep 17 00:00:00 2001 From: Man Cao Date: Fri, 11 Aug 2023 20:43:31 +0000 Subject: [PATCH 025/162] 8314139: TEST_BUG: runtime/os/THPsInThreadStackPreventionTest.java could fail on machine with large number of cores Reviewed-by: shade, stuefe --- .../jtreg/runtime/os/THPsInThreadStackPreventionTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java b/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java index 83d382f8ec6..f5ec01e43a6 100644 --- a/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java +++ b/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java @@ -165,6 +165,9 @@ public static void main(String[] args) throws Exception { "-Xmx" + heapSizeMB + "m", "-Xms" + heapSizeMB + "m", "-XX:+AlwaysPreTouch", // stabilize RSS "-Xss" + threadStackSizeMB + "m", "-XX:-CreateCoredumpOnCrash", + // Limits the number of JVM-internal threads, which depends on the available cores of the + // machine. RSS+Swap could exceed acceptableRSSLimitMB when JVM creates many internal threads. + "-XX:ActiveProcessorCount=2", // This will delay the child threads before they create guard pages, thereby greatly increasing the // chance of large VMA formation + hugepage coalescation; see JDK-8312182 "-XX:+DelayThreadStartALot" From ec0cc6300a02dd92b25d9072b8b3859dab583bbd Mon Sep 17 00:00:00 2001 From: Alexander Matveev Date: Fri, 11 Aug 2023 21:00:52 +0000 Subject: [PATCH 026/162] 8313904: [macos] All signing tests which verifies unsigned app images are failing Reviewed-by: asemenyuk --- .../jpackage/internal/MacAppImageBuilder.java | 2 +- .../internal/MacBaseInstallerBundler.java | 8 +- ...SigningPackageFromTwoStepAppImageTest.java | 4 +- .../jpackage/macosx/SigningPackageTest.java | 4 +- .../macosx/SigningPackageTwoStepTest.java | 6 +- .../jpackage/macosx/base/SigningBase.java | 94 ++++++++++++++----- .../tools/jpackage/share/AppContentTest.java | 4 +- .../jpackage/share/AppImagePackageTest.java | 8 +- 8 files changed, 94 insertions(+), 36 deletions(-) diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java index da174a50bfd..d9250ae1474 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java @@ -715,7 +715,7 @@ private static List getCodesignArgs( return args; } - private static void signAppBundle( + static void signAppBundle( Map params, Path appLocation, String signingIdentity, String identifierPrefix, Path entitlements) throws IOException { diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java index 5bcccc061a4..31bef8416fc 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -188,6 +188,12 @@ protected Path prepareAppBundle(Map params) !AppImageFile.load(predefinedImage).isSigned()) { new PackageFile(APP_NAME.fetchFrom(params)).save( ApplicationLayout.macAppImage().resolveAt(appDir)); + // We need to re-sign app image after adding ".package" to it. + // We only do this if app image was not signed which means it is + // signed with ad-hoc signature. App bundles with ad-hoc + // signature are sealed, but without a signing identity, so we + // need to re-sign it after modification. + MacAppImageBuilder.signAppBundle(params, appDir, "-", null, null); } } else { appDir = appImageBundler.execute(params, appImageRoot); diff --git a/test/jdk/tools/jpackage/macosx/SigningPackageFromTwoStepAppImageTest.java b/test/jdk/tools/jpackage/macosx/SigningPackageFromTwoStepAppImageTest.java index 79c06607482..29b4ec50bc6 100644 --- a/test/jdk/tools/jpackage/macosx/SigningPackageFromTwoStepAppImageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningPackageFromTwoStepAppImageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,7 +79,7 @@ private static void verifyPKG(JPackageCommand cmd) { private static void verifyDMG(JPackageCommand cmd) { // DMG always unsigned, so we will check it Path outputBundle = cmd.outputBundle(); - SigningBase.verifyCodesign(outputBundle, false); + SigningBase.verifyDMG(outputBundle); } private static void verifyAppImageInDMG(JPackageCommand cmd) { diff --git a/test/jdk/tools/jpackage/macosx/SigningPackageTest.java b/test/jdk/tools/jpackage/macosx/SigningPackageTest.java index f355a28b6a3..e7bb97784a5 100644 --- a/test/jdk/tools/jpackage/macosx/SigningPackageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningPackageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,7 +71,7 @@ private static void verifyPKG(JPackageCommand cmd) { private static void verifyDMG(JPackageCommand cmd) { Path outputBundle = cmd.outputBundle(); - SigningBase.verifyCodesign(outputBundle, false); + SigningBase.verifyDMG(outputBundle); } private static void verifyAppImageInDMG(JPackageCommand cmd) { diff --git a/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java b/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java index 5dde721bdad..f0442f92af4 100644 --- a/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ * @build SigningPackageTwoStepTest * @modules jdk.jpackage/jdk.jpackage.internal * @requires (os.family == "mac") - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=SigningPackageTwoStepTest */ public class SigningPackageTwoStepTest { @@ -80,7 +80,7 @@ private static void verifyPKG(JPackageCommand cmd) { private static void verifyDMG(JPackageCommand cmd) { // DMG always unsigned, so we will check it Path outputBundle = cmd.outputBundle(); - SigningBase.verifyCodesign(outputBundle, false); + SigningBase.verifyDMG(outputBundle); } private static void verifyAppImageInDMG(JPackageCommand cmd) { diff --git a/test/jdk/tools/jpackage/macosx/base/SigningBase.java b/test/jdk/tools/jpackage/macosx/base/SigningBase.java index 3126c3f8b99..cedd0721b25 100644 --- a/test/jdk/tools/jpackage/macosx/base/SigningBase.java +++ b/test/jdk/tools/jpackage/macosx/base/SigningBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,35 +44,67 @@ public class SigningBase { KEYCHAIN = (value == null) ? "jpackagerTest.keychain" : value; } + // Note: It is not clear if we can combine "--verify" and "--display", so + // we testing them separately. Since JDK-8298488 unsigned app images are + // actually signed with adhoc signature and it will pass "--verify", so in + // addition we will check certificate name which was used to sign. + private static enum CodesignCheckType { + VERIFY, // Runs codesign with "--verify" to check signature and 0 exit code + VERIFY_UNSIGNED, // Runs codesign with "--verify" to check signature and 1 exit code + DISPLAY // Runs codesign with "--display --verbose=4" to get info about signature + }; + private static void checkString(List result, String lookupString) { TKit.assertTextStream(lookupString).predicate( (line, what) -> line.trim().contains(what)).apply(result.stream()); } - private static List codesignResult(Path target, boolean signed) { - int exitCode = signed ? 0 : 1; - List result = new Executor() - .setExecutable("/usr/bin/codesign") - .addArguments("--verify", "--deep", "--strict", "--verbose=2", - target.toString()) - .saveOutput() - .execute(exitCode).getOutput(); - - return result; + private static List codesignResult(Path target, CodesignCheckType type) { + int exitCode = 0; + Executor executor = new Executor().setExecutable("/usr/bin/codesign"); + switch (type) { + case CodesignCheckType.VERIFY_UNSIGNED: + exitCode = 1; + case CodesignCheckType.VERIFY: + executor.addArguments("--verify", "--deep", "--strict", + "--verbose=2", target.toString()); + break; + case CodesignCheckType.DISPLAY: + executor.addArguments("--display", "--verbose=4", target.toString()); + break; + default: + TKit.error("Unknown CodesignCheckType: " + type); + break; + } + return executor.saveOutput().execute(exitCode).getOutput(); } private static void verifyCodesignResult(List result, Path target, - boolean signed) { + boolean signed, CodesignCheckType type) { result.stream().forEachOrdered(TKit::trace); - if (signed) { - String lookupString = target.toString() + ": valid on disk"; - checkString(result, lookupString); - lookupString = target.toString() + ": satisfies its Designated Requirement"; - checkString(result, lookupString); - } else { - String lookupString = target.toString() - + ": code object is not signed at all"; - checkString(result, lookupString); + String lookupString; + switch (type) { + case CodesignCheckType.VERIFY: + lookupString = target.toString() + ": valid on disk"; + checkString(result, lookupString); + lookupString = target.toString() + ": satisfies its Designated Requirement"; + checkString(result, lookupString); + break; + case CodesignCheckType.VERIFY_UNSIGNED: + lookupString = target.toString() + ": code object is not signed at all"; + checkString(result, lookupString); + break; + case CodesignCheckType.DISPLAY: + if (signed) { + lookupString = "Authority=" + APP_CERT; + } else { + lookupString = "Signature=adhoc"; + } + checkString(result, lookupString); + break; + default: + TKit.error("Unknown CodesignCheckType: " + type); + break; } } @@ -132,8 +164,24 @@ private static void verifyPkgutilResult(List result) { } public static void verifyCodesign(Path target, boolean signed) { - List result = codesignResult(target, signed); - verifyCodesignResult(result, target, signed); + List result = codesignResult(target, CodesignCheckType.VERIFY); + verifyCodesignResult(result, target, signed, CodesignCheckType.VERIFY); + + result = codesignResult(target, CodesignCheckType.DISPLAY); + verifyCodesignResult(result, target, signed, CodesignCheckType.DISPLAY); + } + + // Since we no longer have unsigned app image, but we need to check + // DMG which is not adhoc or certificate signed and we cannot use verifyCodesign + // for this. verifyDMG() is introduced to check that DMG is unsigned. + // Should not be used to validated anything else. + public static void verifyDMG(Path target) { + if (!target.toString().toLowerCase().endsWith(".dmg")) { + TKit.error("Unexpected target: " + target); + } + + List result = codesignResult(target, CodesignCheckType.VERIFY_UNSIGNED); + verifyCodesignResult(result, target, false, CodesignCheckType.VERIFY_UNSIGNED); } public static void verifySpctl(Path target, String type) { diff --git a/test/jdk/tools/jpackage/share/AppContentTest.java b/test/jdk/tools/jpackage/share/AppContentTest.java index 666fafb7168..b31a6e637b2 100644 --- a/test/jdk/tools/jpackage/share/AppContentTest.java +++ b/test/jdk/tools/jpackage/share/AppContentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -99,7 +99,7 @@ public void test() throws Exception { } }) - // On macOS aarch64 we always signing app image and signing will fail, since + // On macOS we always signing app image and signing will fail, since // test produces invalid app bundle. .setExpectedExitCode(testPathArgs.contains(TEST_BAD) || TKit.isOSX() ? 1 : 0) .run(); diff --git a/test/jdk/tools/jpackage/share/AppImagePackageTest.java b/test/jdk/tools/jpackage/share/AppImagePackageTest.java index 491182b50ab..4f229e5c934 100644 --- a/test/jdk/tools/jpackage/share/AppImagePackageTest.java +++ b/test/jdk/tools/jpackage/share/AppImagePackageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,7 +94,11 @@ public static void testEmpty(boolean withIcon) throws IOException { if (TKit.isOSX()) { cmd.addArguments("--mac-package-identifier", name); } - }).run(Action.CREATE, Action.UNPACK); + }) + // On macOS we always signing app image and signing will fail, since + // test produces invalid app bundle. + .setExpectedExitCode(TKit.isOSX() ? 1 : 0) + .run(Action.CREATE, Action.UNPACK); // default: {CREATE, UNPACK, VERIFY}, but we can't verify foreign image } From b88c27350328da86e9dc46c8061c6563fdf858a2 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Mon, 14 Aug 2023 07:04:05 +0000 Subject: [PATCH 027/162] 8313743: Make fields final in sun.nio.ch Reviewed-by: bpb --- .../sun/nio/ch/AsynchronousChannelGroupImpl.java | 4 ++-- .../nio/ch/AsynchronousServerSocketChannelImpl.java | 4 ++-- .../share/classes/sun/nio/ch/FileLockTable.java | 10 +++++----- .../share/classes/sun/nio/ch/IOVecWrapper.java | 4 ++-- src/java.base/share/classes/sun/nio/ch/OptionKey.java | 6 +++--- src/java.base/share/classes/sun/nio/ch/Util.java | 6 +++--- .../windows/classes/sun/nio/ch/PollArrayWrapper.java | 4 ++-- .../nio/ch/WindowsAsynchronousSocketChannelImpl.java | 5 ++--- .../classes/sun/nio/ch/WindowsSelectorImpl.java | 9 ++++----- 9 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java b/src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java index 4751cdea3d3..0c15c1a6439 100644 --- a/src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,7 +59,7 @@ abstract class AsynchronousChannelGroupImpl private final AtomicInteger threadCount = new AtomicInteger(); // associated Executor for timeouts - private ScheduledThreadPoolExecutor timeoutExecutor; + private final ScheduledThreadPoolExecutor timeoutExecutor; // task queue for when using a fixed thread pool. In that case, a thread // waiting on I/O events must be awoken to poll tasks from this queue. diff --git a/src/java.base/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java index 8ce7ef1f986..cdc3a883734 100644 --- a/src/java.base/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ abstract class AsynchronousServerSocketChannelImpl private final Object stateLock = new Object(); // close support - private ReadWriteLock closeLock = new ReentrantReadWriteLock(); + private final ReadWriteLock closeLock = new ReentrantReadWriteLock(); private volatile boolean closed; // set true when accept operation is cancelled diff --git a/src/java.base/share/classes/sun/nio/ch/FileLockTable.java b/src/java.base/share/classes/sun/nio/ch/FileLockTable.java index 9b7b7081f94..4b820a63d1d 100644 --- a/src/java.base/share/classes/sun/nio/ch/FileLockTable.java +++ b/src/java.base/share/classes/sun/nio/ch/FileLockTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ class FileLockTable { * FileLock (and FileChannel) alive. */ private static class FileLockReference extends WeakReference { - private FileKey fileKey; + private final FileKey fileKey; FileLockReference(FileLock referent, ReferenceQueue queue, @@ -66,11 +66,11 @@ FileKey fileKey() { // The system-wide map is a ConcurrentHashMap that is keyed on the FileKey. // The map value is a list of file locks represented by FileLockReferences. // All access to the list must be synchronized on the list. - private static ConcurrentHashMap> lockMap = - new ConcurrentHashMap>(); + private static final ConcurrentHashMap> lockMap = + new ConcurrentHashMap<>(); // reference queue for cleared refs - private static ReferenceQueue queue = new ReferenceQueue(); + private static final ReferenceQueue queue = new ReferenceQueue<>(); // The connection to which this table is connected private final Channel channel; diff --git a/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java b/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java index a2319d23e0e..d33d7f55d0b 100644 --- a/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java +++ b/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ class IOVecWrapper { final long address; // Address size in bytes - static int addressSize; + static final int addressSize; private static class Deallocator implements Runnable { private final AllocatedNativeObject obj; diff --git a/src/java.base/share/classes/sun/nio/ch/OptionKey.java b/src/java.base/share/classes/sun/nio/ch/OptionKey.java index ebb272aea44..1b8a58e1d05 100644 --- a/src/java.base/share/classes/sun/nio/ch/OptionKey.java +++ b/src/java.base/share/classes/sun/nio/ch/OptionKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ */ class OptionKey { - private int level; - private int name; + private final int level; + private final int name; OptionKey(int level, int name) { this.level = level; diff --git a/src/java.base/share/classes/sun/nio/ch/Util.java b/src/java.base/share/classes/sun/nio/ch/Util.java index 1f30a119360..bf9fc0c0f7c 100644 --- a/src/java.base/share/classes/sun/nio/ch/Util.java +++ b/src/java.base/share/classes/sun/nio/ch/Util.java @@ -53,7 +53,7 @@ public class Util { private static final long MAX_CACHED_BUFFER_SIZE = getMaxCachedBufferSize(); // Per-carrier-thread cache of temporary direct buffers - private static TerminatingThreadLocal bufferCache = new TerminatingThreadLocal<>() { + private static final TerminatingThreadLocal bufferCache = new TerminatingThreadLocal<>() { @Override protected BufferCache initialValue() { return new BufferCache(); @@ -112,7 +112,7 @@ private static boolean isBufferTooLarge(ByteBuffer buf) { */ private static class BufferCache { // the array of buffers - private ByteBuffer[] buffers; + private final ByteBuffer[] buffers; // the number of buffers in the cache private int count; @@ -378,7 +378,7 @@ public boolean addAll(Collection coll) { // -- Unsafe access -- - private static Unsafe unsafe = Unsafe.getUnsafe(); + private static final Unsafe unsafe = Unsafe.getUnsafe(); private static byte _get(long a) { return unsafe.getByte(a); diff --git a/src/java.base/windows/classes/sun/nio/ch/PollArrayWrapper.java b/src/java.base/windows/classes/sun/nio/ch/PollArrayWrapper.java index fac5cfd9de9..1a33d47d27c 100644 --- a/src/java.base/windows/classes/sun/nio/ch/PollArrayWrapper.java +++ b/src/java.base/windows/classes/sun/nio/ch/PollArrayWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ class PollArrayWrapper { @Native private static final short FD_OFFSET = 0; // fd offset in pollfd @Native private static final short EVENT_OFFSET = 4; // events offset in pollfd - static short SIZE_POLLFD = 8; // sizeof pollfd struct + static final short SIZE_POLLFD = 8; // sizeof pollfd struct private int size; // Size of the pollArray diff --git a/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java b/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java index 22cdcfa17cc..20fdfc46ae3 100644 --- a/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java +++ b/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,10 +45,9 @@ class WindowsAsynchronousSocketChannelImpl extends AsynchronousSocketChannelImpl implements Iocp.OverlappedChannel { private static final Unsafe unsafe = Unsafe.getUnsafe(); - private static int addressSize = unsafe.addressSize(); private static int dependsArch(int value32, int value64) { - return (addressSize == 4) ? value32 : value64; + return (unsafe.addressSize() == 4) ? value32 : value64; } /* diff --git a/src/java.base/windows/classes/sun/nio/ch/WindowsSelectorImpl.java b/src/java.base/windows/classes/sun/nio/ch/WindowsSelectorImpl.java index df26857c04b..977a1653fdd 100644 --- a/src/java.base/windows/classes/sun/nio/ch/WindowsSelectorImpl.java +++ b/src/java.base/windows/classes/sun/nio/ch/WindowsSelectorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,14 +49,13 @@ class WindowsSelectorImpl extends SelectorImpl { private static final Unsafe unsafe = Unsafe.getUnsafe(); - private static int addressSize = unsafe.addressSize(); private static int dependsArch(int value32, int value64) { - return (addressSize == 4) ? value32 : value64; + return (unsafe.addressSize() == 4) ? value32 : value64; } // Initial capacity of the poll array - private final int INIT_CAP = 8; + private static final int INIT_CAP = 8; // Maximum number of sockets for select(). // Should be INIT_CAP times a power of 2 private static final int MAX_SELECTABLE_FDS = 1024; @@ -74,7 +73,7 @@ private static int dependsArch(int value32, int value64) { private SelectionKeyImpl[] channelArray = new SelectionKeyImpl[INIT_CAP]; // The global native poll array holds file descriptors and event masks - private PollArrayWrapper pollWrapper; + private final PollArrayWrapper pollWrapper; // The number of valid entries in poll array, including entries occupied // by wakeup socket handle. From 6bbcef53154e6b669ef53e01eb95bc1b568dc0c6 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Mon, 14 Aug 2023 07:04:29 +0000 Subject: [PATCH 028/162] 8313948: Remove unnecessary static fields defaultUpper/defaultLower in sun.net.PortConfig Reviewed-by: dfuchs --- src/java.base/unix/classes/sun/net/PortConfig.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java.base/unix/classes/sun/net/PortConfig.java b/src/java.base/unix/classes/sun/net/PortConfig.java index 4e9deeb90fb..428870c9222 100644 --- a/src/java.base/unix/classes/sun/net/PortConfig.java +++ b/src/java.base/unix/classes/sun/net/PortConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,13 +35,14 @@ public final class PortConfig { - private static int defaultUpper, defaultLower; private static final int upper, lower; private PortConfig() {} static { jdk.internal.loader.BootLoader.loadLibrary("net"); + int defaultUpper; + int defaultLower; switch (OperatingSystem.current()) { case LINUX: defaultLower = 32768; From 5c9162288570a140138a0055cd9c4e88fe40e69d Mon Sep 17 00:00:00 2001 From: Feilong Jiang Date: Mon, 14 Aug 2023 07:50:43 +0000 Subject: [PATCH 029/162] 8314117: RISC-V: Incorrect VMReg encoding in RISCV64Frame.java Reviewed-by: fyang --- .../classes/sun/jvm/hotspot/runtime/riscv64/RISCV64Frame.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/riscv64/RISCV64Frame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/riscv64/RISCV64Frame.java index 6db450727d1..90d070112db 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/riscv64/RISCV64Frame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/riscv64/RISCV64Frame.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2019, Red Hat Inc. - * Copyright (c) 2021, 2022, Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2021, 2023, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,7 +71,7 @@ public class RISCV64Frame extends Frame { // Native frames private static final int NATIVE_FRAME_INITIAL_PARAM_OFFSET = 2; - private static VMReg fp = new VMReg(8); + private static VMReg fp = new VMReg(8 << 1); static { VM.registerVMInitializedObserver(new Observer() { From 1de5bf1ce94c20bc2fd481cd4387f170b0d3c63d Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 14 Aug 2023 08:14:42 +0000 Subject: [PATCH 030/162] 8314106: C2: assert(is_valid()) failed: must be valid after JDK-8305636 Reviewed-by: thartmann, kvn --- src/hotspot/share/opto/loopPredicate.cpp | 4 +- ...LoopUnswitchingWithoutParsePredicates.java | 65 +++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/predicates/TestLoopUnswitchingWithoutParsePredicates.java diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index 906af75091a..6c655e6f137 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -445,9 +445,8 @@ void PhaseIdealLoop::clone_loop_predication_predicates_to_unswitched_loop(IdealL Deoptimization::DeoptReason reason, IfProjNode*& iffast_pred, IfProjNode*& ifslow_pred) { - if (predicate_block->is_non_empty()) { + if (predicate_block->has_parse_predicate()) { clone_parse_predicate_to_unswitched_loops(predicate_block, reason, iffast_pred, ifslow_pred); - clone_assertion_predicates_to_unswitched_loop(loop, old_new, reason, predicate_block->parse_predicate_success_proj(), iffast_pred, ifslow_pred); } @@ -456,6 +455,7 @@ void PhaseIdealLoop::clone_loop_predication_predicates_to_unswitched_loop(IdealL void PhaseIdealLoop::clone_parse_predicate_to_unswitched_loops(const PredicateBlock* predicate_block, Deoptimization::DeoptReason reason, IfProjNode*& iffast_pred, IfProjNode*& ifslow_pred) { + assert(predicate_block->has_parse_predicate(), "must have parse predicate"); ParsePredicateSuccessProj* parse_predicate_proj = predicate_block->parse_predicate_success_proj(); iffast_pred = clone_parse_predicate_to_unswitched_loop(parse_predicate_proj, iffast_pred, reason, false); check_cloned_parse_predicate_for_unswitching(iffast_pred, true); diff --git a/test/hotspot/jtreg/compiler/predicates/TestLoopUnswitchingWithoutParsePredicates.java b/test/hotspot/jtreg/compiler/predicates/TestLoopUnswitchingWithoutParsePredicates.java new file mode 100644 index 00000000000..e84908fd429 --- /dev/null +++ b/test/hotspot/jtreg/compiler/predicates/TestLoopUnswitchingWithoutParsePredicates.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8314106 + * @summary Test that we do not try to copy a Parse Predicate to an unswitched loop if they do not exist anymore. + * @run main/othervm -Xbatch -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,compiler.predicates.TestLoopUnswitchingWithoutParsePredicates::* + * compiler.predicates.TestLoopUnswitchingWithoutParsePredicates + */ + +package compiler.predicates; + +public class TestLoopUnswitchingWithoutParsePredicates { + static byte byFld; + static byte byArrFld[] = new byte[400]; + + public static void main(String[] strArr) { + for (int i = 0; i < 1000;i++) { + test(i); + } + } + + static void test(int i2) { + int i10, i11 = 0, i12, i13, i14; + double dArr[] = new double[400]; + for (i10 = 7; i10 < 307; i10++) { + byArrFld[i10] = 58; + for (i12 = 1; i12 < 3; i12++) { + for (i14 = 1; i14 < 2; i14++) { + byFld &= i14; + switch (i2) { + case 4: + dArr[1] = i14; + case 2: + i13 = i11; + } + } + } + } + } +} + From a39ed1087b3c188f06c9aa602313f3b9bf20f9c2 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 14 Aug 2023 08:15:02 +0000 Subject: [PATCH 031/162] 8314116: C2: assert(false) failed: malformed control flow after JDK-8305636 Reviewed-by: thartmann, kvn --- src/hotspot/share/opto/loopTransform.cpp | 2 +- ...tTemplateAssertionPredicateNotRemoved.java | 85 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/compiler/predicates/TestTemplateAssertionPredicateNotRemoved.java diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index a3f59e2bb9c..29b878877e8 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -2073,7 +2073,7 @@ void PhaseIdealLoop::initialize_assertion_predicates_for_peeled_loop(const Predi Node* stride, IdealLoopTree* outer_loop, const uint idx_before_clone, const Node_List &old_new) { - if (!predicate_block->has_runtime_predicates()) { + if (!predicate_block->has_parse_predicate()) { return; } Node* control = outer_loop_head->in(LoopNode::EntryControl); diff --git a/test/hotspot/jtreg/compiler/predicates/TestTemplateAssertionPredicateNotRemoved.java b/test/hotspot/jtreg/compiler/predicates/TestTemplateAssertionPredicateNotRemoved.java new file mode 100644 index 00000000000..557d9d461bf --- /dev/null +++ b/test/hotspot/jtreg/compiler/predicates/TestTemplateAssertionPredicateNotRemoved.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8314116 + * @summary We fail to remove a Template Assertion Predicate of a dying loop causing an assert. This will only be fixed + * completely with JDK-8288981 and 8314116 just mitigates the problem. + * @requires vm.compiler2.enabled + * @run main/othervm -Xbatch -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,compiler.predicates.TestTemplateAssertionPredicateNotRemoved::* + * compiler.predicates.TestTemplateAssertionPredicateNotRemoved + * @run main/othervm -Xbatch -XX:-TieredCompilation -XX:LoopMaxUnroll=0 + * -XX:CompileCommand=compileonly,compiler.predicates.TestTemplateAssertionPredicateNotRemoved::* + * compiler.predicates.TestTemplateAssertionPredicateNotRemoved + */ + +package compiler.predicates; + +public class TestTemplateAssertionPredicateNotRemoved { + static int[] iArrFld = new int[10]; + static long x; + public static void main(String[] strArr) { + for (int i = 0; i < 10000; i++) { + test(i); + test2(i); + } + } + + static void test(int i1) { + int i5, i6 = 8; + + for (int i3 = 100; i3 > 3; --i3) { + for (i5 = 1; i5 < 5; i5++) { + switch (i1) { + case 1: + case 4: + case 47: + i6 = 4; + } + iArrFld[i5] = 23; + } + } + } + + static void test2(int i1) { + int i3, i4 = 70, i5, i6 = 8, iArr1[] = new int[10]; + double d1 = 0.41007; + for (i3 = 100; i3 > 3; --i3) { + i4 += 3; + for (i5 = 1; i5 < 5; i5++) { + switch (i1) { + case 1: + case 4: + case 47: + i6 = 34; + } + x /= 34; + iArrFld[i5] = 23; + } + } + + } +} From 049b55f24e33559816c2b4b1abfda54f44fe87f5 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Mon, 14 Aug 2023 08:45:16 +0000 Subject: [PATCH 032/162] 8314019: Add gc logging to jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java Reviewed-by: aboldtch, eosterlund --- .../jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java b/test/jdk/jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java index 3222559554e..2306d33b651 100644 --- a/test/jdk/jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java +++ b/test/jdk/jdk/jfr/event/gc/detailed/TestZAllocationStallEvent.java @@ -36,7 +36,7 @@ * @requires vm.hasJFR & vm.gc.ZSinglegen * @key jfr * @library /test/lib /test/jdk /test/hotspot/jtreg - * @run main/othervm -XX:+UseZGC -XX:-ZGenerational -Xmx32M jdk.jfr.event.gc.detailed.TestZAllocationStallEvent + * @run main/othervm -XX:+UseZGC -XX:-ZGenerational -Xmx32M -Xlog:gc*:gc.log::filecount=0 jdk.jfr.event.gc.detailed.TestZAllocationStallEvent */ /** @@ -44,7 +44,7 @@ * @requires vm.hasJFR & vm.gc.ZGenerational * @key jfr * @library /test/lib /test/jdk /test/hotspot/jtreg - * @run main/othervm -XX:+UseZGC -XX:+ZGenerational -Xmx32M jdk.jfr.event.gc.detailed.TestZAllocationStallEvent + * @run main/othervm -XX:+UseZGC -XX:+ZGenerational -Xmx32M -Xlog:gc*:gc.log::filecount=0 jdk.jfr.event.gc.detailed.TestZAllocationStallEvent */ public class TestZAllocationStallEvent { From 4164693f3bf15a2f3e03dee72e1ca3fb8d82582c Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Mon, 14 Aug 2023 08:56:15 +0000 Subject: [PATCH 033/162] 8313372: [JVMCI] Export vmIntrinsics::is_intrinsic_available results to JVMCI compilers. Reviewed-by: dnsimon, kvn --- src/hotspot/share/c1/c1_Compiler.cpp | 3 ++ src/hotspot/share/c1/c1_Compiler.hpp | 3 ++ .../share/jvmci/jvmciCompilerToVMInit.cpp | 11 +++++-- src/hotspot/share/jvmci/jvmciEnv.cpp | 7 +++-- src/hotspot/share/jvmci/jvmciEnv.hpp | 2 +- src/hotspot/share/jvmci/jvmciJavaClasses.hpp | 5 +++- src/hotspot/share/opto/c2compiler.cpp | 25 ++++++++++++---- src/hotspot/share/opto/c2compiler.hpp | 2 ++ .../vm/ci/hotspot/HotSpotVMConfigStore.java | 3 +- .../jdk/vm/ci/hotspot/VMIntrinsicMethod.java | 30 +++++++++++++++++-- 10 files changed, 74 insertions(+), 17 deletions(-) diff --git a/src/hotspot/share/c1/c1_Compiler.cpp b/src/hotspot/share/c1/c1_Compiler.cpp index ec06cbb1b41..567cd5fa8b5 100644 --- a/src/hotspot/share/c1/c1_Compiler.cpp +++ b/src/hotspot/share/c1/c1_Compiler.cpp @@ -104,7 +104,10 @@ bool Compiler::is_intrinsic_supported(const methodHandle& method) { // C1 does not support intrinsification of synchronized methods. return false; } + return Compiler::is_intrinsic_supported(id); +} +bool Compiler::is_intrinsic_supported(vmIntrinsics::ID id) { switch (id) { case vmIntrinsics::_compareAndSetLong: if (!VM_Version::supports_cx8()) return false; diff --git a/src/hotspot/share/c1/c1_Compiler.hpp b/src/hotspot/share/c1/c1_Compiler.hpp index 8f2afa85dba..9095a13297e 100644 --- a/src/hotspot/share/c1/c1_Compiler.hpp +++ b/src/hotspot/share/c1/c1_Compiler.hpp @@ -56,6 +56,9 @@ class Compiler: public AbstractCompiler { // Check if the C1 compiler supports an intrinsic for 'method'. virtual bool is_intrinsic_supported(const methodHandle& method); + // Return true if the intrinsic `id` is supported by C1 + static bool is_intrinsic_supported(vmIntrinsics::ID id); + // Size of the code buffer static int code_buffer_size(); }; diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index 64d28617b78..d645a43d9be 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -22,6 +22,7 @@ */ // no precompiled headers +#include "c1/c1_Compiler.hpp" #include "ci/ciUtilities.hpp" #include "compiler/compiler_globals.hpp" #include "compiler/oopMap.hpp" @@ -42,6 +43,7 @@ #include "memory/universe.hpp" #include "oops/compressedOops.hpp" #include "oops/klass.inline.hpp" +#include "opto/c2compiler.hpp" #include "runtime/flags/jvmFlag.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" @@ -239,7 +241,10 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) { } \ JVMCIObject name_str = VM_SYMBOL_TO_STRING(name); \ JVMCIObject sig_str = VM_SYMBOL_TO_STRING(sig); \ - JVMCIObject vmIntrinsicMethod = JVMCIENV->new_VMIntrinsicMethod(kls_str, name_str, sig_str, (jint) vmIntrinsics::id, JVMCI_CHECK_NULL); \ + JVMCIObject vmIntrinsicMethod = JVMCIENV->new_VMIntrinsicMethod(kls_str, name_str, sig_str, (jint) vmIntrinsics::id, \ + (jboolean) vmIntrinsics::is_intrinsic_available(vmIntrinsics::id), \ + (jboolean) Compiler::is_intrinsic_supported(vmIntrinsics::id), \ + (jboolean) C2Compiler::is_intrinsic_supported(vmIntrinsics::id), JVMCI_CHECK_NULL); \ JVMCIENV->put_object_at(vmIntrinsics, index++, vmIntrinsicMethod); \ } @@ -286,7 +291,7 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) { do_uintx_flag(TLABWasteIncrement) \ do_intx_flag(TypeProfileWidth) \ do_bool_flag(UseAESIntrinsics) \ - X86_ONLY(do_int_flag(UseAVX)) \ + X86_ONLY(do_int_flag(UseAVX)) \ do_bool_flag(UseCRC32Intrinsics) \ do_bool_flag(UseAdler32Intrinsics) \ do_bool_flag(UseCompressedClassPointers) \ @@ -306,7 +311,7 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) { do_bool_flag(UseSHA1Intrinsics) \ do_bool_flag(UseSHA256Intrinsics) \ do_bool_flag(UseSHA512Intrinsics) \ - X86_ONLY(do_int_flag(UseSSE)) \ + X86_ONLY(do_int_flag(UseSSE)) \ COMPILER2_PRESENT(do_bool_flag(UseSquareToLenIntrinsic)) \ do_bool_flag(UseTLAB) \ do_bool_flag(VerifyOops) \ diff --git a/src/hotspot/share/jvmci/jvmciEnv.cpp b/src/hotspot/share/jvmci/jvmciEnv.cpp index e70f2785426..d61cc269874 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.cpp +++ b/src/hotspot/share/jvmci/jvmciEnv.cpp @@ -1459,7 +1459,7 @@ JVMCIObject JVMCIEnv::new_VMFlag(JVMCIObject name, JVMCIObject type, JVMCIObject } } -JVMCIObject JVMCIEnv::new_VMIntrinsicMethod(JVMCIObject declaringClass, JVMCIObject name, JVMCIObject descriptor, int id, JVMCI_TRAPS) { +JVMCIObject JVMCIEnv::new_VMIntrinsicMethod(JVMCIObject declaringClass, JVMCIObject name, JVMCIObject descriptor, int id, jboolean isAvailable, jboolean c1Supported, jboolean c2Supported, JVMCI_TRAPS) { JavaThread* THREAD = JavaThread::current(); // For exception macros. if (is_hotspot()) { HotSpotJVMCI::VMIntrinsicMethod::klass()->initialize(CHECK_(JVMCIObject())); @@ -1468,12 +1468,15 @@ JVMCIObject JVMCIEnv::new_VMIntrinsicMethod(JVMCIObject declaringClass, JVMCIObj HotSpotJVMCI::VMIntrinsicMethod::set_name(this, obj, HotSpotJVMCI::resolve(name)); HotSpotJVMCI::VMIntrinsicMethod::set_descriptor(this, obj, HotSpotJVMCI::resolve(descriptor)); HotSpotJVMCI::VMIntrinsicMethod::set_id(this, obj, id); + HotSpotJVMCI::VMIntrinsicMethod::set_isAvailable(this, obj, isAvailable); + HotSpotJVMCI::VMIntrinsicMethod::set_c1Supported(this, obj, c1Supported); + HotSpotJVMCI::VMIntrinsicMethod::set_c2Supported(this, obj, c2Supported); return wrap(obj); } else { JNIAccessMark jni(this, THREAD); jobject result = jni()->NewObject(JNIJVMCI::VMIntrinsicMethod::clazz(), JNIJVMCI::VMIntrinsicMethod::constructor(), - get_jobject(declaringClass), get_jobject(name), get_jobject(descriptor), id); + get_jobject(declaringClass), get_jobject(name), get_jobject(descriptor), id, isAvailable, c1Supported, c2Supported); return wrap(result); } } diff --git a/src/hotspot/share/jvmci/jvmciEnv.hpp b/src/hotspot/share/jvmci/jvmciEnv.hpp index ca76d6501f2..345504affb8 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.hpp +++ b/src/hotspot/share/jvmci/jvmciEnv.hpp @@ -406,7 +406,7 @@ class JVMCIEnv : public ResourceObj { JVMCIObject new_HotSpotNmethod(const methodHandle& method, const char* name, jboolean isDefault, jlong compileId, JVMCI_TRAPS); JVMCIObject new_VMField(JVMCIObject name, JVMCIObject type, jlong offset, jlong address, JVMCIObject value, JVMCI_TRAPS); JVMCIObject new_VMFlag(JVMCIObject name, JVMCIObject type, JVMCIObject value, JVMCI_TRAPS); - JVMCIObject new_VMIntrinsicMethod(JVMCIObject declaringClass, JVMCIObject name, JVMCIObject descriptor, int id, JVMCI_TRAPS); + JVMCIObject new_VMIntrinsicMethod(JVMCIObject declaringClass, JVMCIObject name, JVMCIObject descriptor, int id, jboolean isAvailable, jboolean c1Supported, jboolean c2Supported, JVMCI_TRAPS); JVMCIObject new_HotSpotStackFrameReference(JVMCI_TRAPS); JVMCIObject new_JVMCIError(JVMCI_TRAPS); JVMCIObject new_FieldInfo(FieldInfo* fieldinfo, JVMCI_TRAPS); diff --git a/src/hotspot/share/jvmci/jvmciJavaClasses.hpp b/src/hotspot/share/jvmci/jvmciJavaClasses.hpp index 9bd87009b11..3561093caaa 100644 --- a/src/hotspot/share/jvmci/jvmciJavaClasses.hpp +++ b/src/hotspot/share/jvmci/jvmciJavaClasses.hpp @@ -131,7 +131,10 @@ object_field(VMIntrinsicMethod, name, "Ljava/lang/String;") \ object_field(VMIntrinsicMethod, descriptor, "Ljava/lang/String;") \ int_field(VMIntrinsicMethod, id) \ - jvmci_constructor(VMIntrinsicMethod, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V") \ + boolean_field(VMIntrinsicMethod, isAvailable) \ + boolean_field(VMIntrinsicMethod, c1Supported) \ + boolean_field(VMIntrinsicMethod, c2Supported) \ + jvmci_constructor(VMIntrinsicMethod, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZZ)V") \ end_class \ start_class(HotSpotCompilationRequestResult, jdk_vm_ci_hotspot_HotSpotCompilationRequestResult) \ object_field(HotSpotCompilationRequestResult, failureMessage, "Ljava/lang/String;") \ diff --git a/src/hotspot/share/opto/c2compiler.cpp b/src/hotspot/share/opto/c2compiler.cpp index 54a23890486..398eb80b8cf 100644 --- a/src/hotspot/share/opto/c2compiler.cpp +++ b/src/hotspot/share/opto/c2compiler.cpp @@ -190,6 +190,10 @@ void C2Compiler::print_timers() { bool C2Compiler::is_intrinsic_supported(const methodHandle& method) { vmIntrinsics::ID id = method->intrinsic_id(); + return C2Compiler::is_intrinsic_supported(id); +} + +bool C2Compiler::is_intrinsic_supported(vmIntrinsics::ID id) { assert(id != vmIntrinsics::_none, "must be a VM intrinsic"); if (id < vmIntrinsics::FIRST_ID || id > vmIntrinsics::LAST_COMPILER_INLINE) { @@ -225,6 +229,21 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method) { case vmIntrinsics::_copyMemory: if (StubRoutines::unsafe_arraycopy() == nullptr) return false; break; + case vmIntrinsics::_electronicCodeBook_encryptAESCrypt: + if (StubRoutines::electronicCodeBook_encryptAESCrypt() == nullptr) return false; + break; + case vmIntrinsics::_electronicCodeBook_decryptAESCrypt: + if (StubRoutines::electronicCodeBook_decryptAESCrypt() == nullptr) return false; + break; + case vmIntrinsics::_galoisCounterMode_AESCrypt: + if (StubRoutines::galoisCounterMode_AESCrypt() == nullptr) return false; + break; + case vmIntrinsics::_bigIntegerRightShiftWorker: + if (StubRoutines::bigIntegerRightShift() == nullptr) return false; + break; + case vmIntrinsics::_bigIntegerLeftShiftWorker: + if (StubRoutines::bigIntegerLeftShift() == nullptr) return false; + break; case vmIntrinsics::_encodeAsciiArray: if (!Matcher::match_rule_supported(Op_EncodeISOArray) || !Matcher::supports_encode_ascii_array) return false; break; @@ -716,10 +735,7 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method) { case vmIntrinsics::_aescrypt_decryptBlock: case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt: case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: - case vmIntrinsics::_electronicCodeBook_encryptAESCrypt: - case vmIntrinsics::_electronicCodeBook_decryptAESCrypt: case vmIntrinsics::_counterMode_AESCrypt: - case vmIntrinsics::_galoisCounterMode_AESCrypt: case vmIntrinsics::_md5_implCompress: case vmIntrinsics::_sha_implCompress: case vmIntrinsics::_sha2_implCompress: @@ -731,8 +747,6 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method) { case vmIntrinsics::_mulAdd: case vmIntrinsics::_montgomeryMultiply: case vmIntrinsics::_montgomerySquare: - case vmIntrinsics::_bigIntegerRightShiftWorker: - case vmIntrinsics::_bigIntegerLeftShiftWorker: case vmIntrinsics::_vectorizedMismatch: case vmIntrinsics::_ghash_processBlocks: case vmIntrinsics::_chacha20Block: @@ -752,7 +766,6 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method) { case vmIntrinsics::_Preconditions_checkLongIndex: case vmIntrinsics::_getObjectSize: break; - case vmIntrinsics::_VectorCompressExpand: case vmIntrinsics::_VectorUnaryOp: case vmIntrinsics::_VectorBinaryOp: diff --git a/src/hotspot/share/opto/c2compiler.hpp b/src/hotspot/share/opto/c2compiler.hpp index 415688cdad4..bfc335c4869 100644 --- a/src/hotspot/share/opto/c2compiler.hpp +++ b/src/hotspot/share/opto/c2compiler.hpp @@ -63,6 +63,8 @@ class C2Compiler : public AbstractCompiler { // Return false otherwise. virtual bool is_intrinsic_supported(const methodHandle& method); + // Return true if the intrinsic `id` is supported by C2 + static bool is_intrinsic_supported(vmIntrinsics::ID id); // Initial size of the code buffer (may be increased at runtime) static int initial_code_buffer_size(int const_size = initial_const_capacity); }; diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java index 647779d5794..0ee69f135c9 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java @@ -184,7 +184,8 @@ void printConfig(HotSpotJVMCIRuntime runtime) { printConfigLine(runtime, "[vmconfig:constant] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue()); } for (VMIntrinsicMethod e : getIntrinsics()) { - printConfigLine(runtime, "[vmconfig:intrinsic] %d = %s.%s %s%n", e.id, e.declaringClass, e.name, e.descriptor); + printConfigLine(runtime, "[vmconfig:intrinsic] %d = (available:%b c1Supported:%b c2Supported:%b) %s.%s %s%n", + e.id, e.isAvailable, e.c1Supported, e.c2Supported, e.declaringClass, e.name, e.descriptor); } } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/VMIntrinsicMethod.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/VMIntrinsicMethod.java index 2de959151b6..d43c9dcca72 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/VMIntrinsicMethod.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/VMIntrinsicMethod.java @@ -54,12 +54,32 @@ public final class VMIntrinsicMethod { */ public final int id; + /** + * This value reflects the `ControlIntrinsic`, `DisableIntrinsic` and `UseXXXIntrinsic` VM flags + * as well as other factors such as the current CPU. + */ + public final boolean isAvailable; + + /** + * True if this intrinsic is supported by C1. + */ + public final boolean c1Supported; + + /** + * True if this intrinsic is supported by C2. + */ + public final boolean c2Supported; + @VMEntryPoint - VMIntrinsicMethod(String declaringClass, String name, String descriptor, int id) { + VMIntrinsicMethod(String declaringClass, String name, String descriptor, int id, + boolean isAvailable, boolean c1Supported, boolean c2Supported) { this.declaringClass = declaringClass; this.name = name; this.descriptor = descriptor; this.id = id; + this.isAvailable = isAvailable; + this.c1Supported = c1Supported; + this.c2Supported = c2Supported; } @Override @@ -69,7 +89,10 @@ public boolean equals(Object obj) { if (that.id == this.id) { assert that.name.equals(this.name) && that.declaringClass.equals(this.declaringClass) && - that.descriptor.equals(this.descriptor); + that.descriptor.equals(this.descriptor) && + that.isAvailable == this.isAvailable && + that.c1Supported == this.c1Supported && + that.c2Supported == this.c2Supported; return true; } } @@ -83,6 +106,7 @@ public int hashCode() { @Override public String toString() { - return String.format("IntrinsicMethod[declaringClass=%s, name=%s, descriptor=%s, id=%d]", declaringClass, name, descriptor, id); + return String.format("IntrinsicMethod[declaringClass=%s, name=%s, descriptor=%s, id=%d, isAvailable=%b, c1Supported=%b, c2Supported=%b]", + declaringClass, name, descriptor, id, isAvailable, c1Supported, c2Supported); } } From 06aa3c5628e749188238dda3d41c776a5a2f7c81 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 14 Aug 2023 10:04:55 +0000 Subject: [PATCH 034/162] 8314118: Update JMH devkit to 1.37 Reviewed-by: erikj, redestad --- make/devkit/createJMHBundle.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/devkit/createJMHBundle.sh b/make/devkit/createJMHBundle.sh index af29a0917d6..c3c97947dab 100644 --- a/make/devkit/createJMHBundle.sh +++ b/make/devkit/createJMHBundle.sh @@ -26,8 +26,8 @@ # Create a bundle in the build directory, containing what's needed to # build and run JMH microbenchmarks from the OpenJDK build. -JMH_VERSION=1.36 -COMMONS_MATH3_VERSION=3.2 +JMH_VERSION=1.37 +COMMONS_MATH3_VERSION=3.6.1 JOPT_SIMPLE_VERSION=5.0.4 BUNDLE_NAME=jmh-$JMH_VERSION.tar.gz From 5bfb82e6fabf977267e043fb7a68b4487051de7d Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Mon, 14 Aug 2023 11:08:31 +0000 Subject: [PATCH 035/162] 8314119: G1: Fix -Wconversion warnings in G1CardSetInlinePtr::card_pos_for Reviewed-by: tschatzl, kbarrett --- src/hotspot/share/gc/g1/g1CardSetContainers.hpp | 2 +- src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp index 3d9ac2180b5..16ec6b59a6d 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp @@ -78,7 +78,7 @@ class G1CardSetInlinePtr : public StackObj { static const uintptr_t SizeFieldMask = (((uint)1 << SizeFieldLen) - 1) << SizeFieldPos; - static uint8_t card_pos_for(uint const idx, uint const bits_per_card) { + static uint card_pos_for(uint const idx, uint const bits_per_card) { return (idx * bits_per_card + HeaderSize); } diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp index 32e3cd5f370..15f69e68cf2 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp @@ -35,7 +35,7 @@ inline G1CardSetInlinePtr::ContainerPtr G1CardSetInlinePtr::merge(ContainerPtr o assert((idx & (SizeFieldMask >> SizeFieldPos)) == idx, "Index %u too large to fit into size field", idx); assert(card_in_region < ((uint)1 << bits_per_card), "Card %u too large to fit into card value field", card_in_region); - uint8_t card_pos = card_pos_for(idx, bits_per_card); + uint card_pos = card_pos_for(idx, bits_per_card); assert(card_pos + bits_per_card < BitsInValue, "Putting card at pos %u with %u bits would extend beyond pointer", card_pos, bits_per_card); // Check that we do not touch any fields we do not own. From 823f5b930c917f36bb32aa0d0bda3ef0187db875 Mon Sep 17 00:00:00 2001 From: Afshin Zafari Date: Mon, 14 Aug 2023 11:57:17 +0000 Subject: [PATCH 036/162] 8308850: Change JVM options with small ranges that get -Wconversion warnings to 32 bits Reviewed-by: dholmes, coleenp, dlong --- src/hotspot/cpu/x86/vm_version_x86.cpp | 6 +++--- src/hotspot/cpu/x86/vm_version_x86.hpp | 2 +- .../share/jvmci/jvmciCompilerToVMInit.cpp | 10 +++++----- .../flags/jvmFlagConstraintsRuntime.cpp | 4 ++-- .../flags/jvmFlagConstraintsRuntime.hpp | 2 +- src/hotspot/share/runtime/globals.hpp | 18 +++++++++--------- src/hotspot/share/utilities/vmError.cpp | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index dbb4e69303d..19028605ddb 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1913,9 +1913,9 @@ void VM_Version::get_processor_features() { } } if (AllocatePrefetchLines > 1) { - log->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize); + log->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize); } else { - log->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize); + log->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize); } } @@ -3169,7 +3169,7 @@ bool VM_Version::is_intel_tsc_synched_at_init() { return false; } -intx VM_Version::allocate_prefetch_distance(bool use_watermark_prefetch) { +int VM_Version::allocate_prefetch_distance(bool use_watermark_prefetch) { // Hardware prefetching (distance/size in bytes): // Pentium 3 - 64 / 32 // Pentium 4 - 256 / 128 diff --git a/src/hotspot/cpu/x86/vm_version_x86.hpp b/src/hotspot/cpu/x86/vm_version_x86.hpp index cb9e806999b..078f14221dd 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.hpp +++ b/src/hotspot/cpu/x86/vm_version_x86.hpp @@ -750,7 +750,7 @@ class VM_Version : public Abstract_VM_Version { static bool supports_compare_and_exchange() { return true; } - static intx allocate_prefetch_distance(bool use_watermark_prefetch); + static int allocate_prefetch_distance(bool use_watermark_prefetch); // SSE2 and later processors implement a 'pause' instruction // that can be used for efficient implementation of diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index d645a43d9be..cf64f3543fb 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -258,12 +258,12 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) { } #define PREDEFINED_CONFIG_FLAGS(do_bool_flag, do_int_flag, do_intx_flag, do_uintx_flag) \ - do_intx_flag(AllocateInstancePrefetchLines) \ - do_intx_flag(AllocatePrefetchDistance) \ + do_int_flag(AllocateInstancePrefetchLines) \ + do_int_flag(AllocatePrefetchDistance) \ do_intx_flag(AllocatePrefetchInstr) \ - do_intx_flag(AllocatePrefetchLines) \ - do_intx_flag(AllocatePrefetchStepSize) \ - do_intx_flag(AllocatePrefetchStyle) \ + do_int_flag(AllocatePrefetchLines) \ + do_int_flag(AllocatePrefetchStepSize) \ + do_int_flag(AllocatePrefetchStyle) \ do_intx_flag(BciProfileWidth) \ do_bool_flag(BootstrapJVMCI) \ do_bool_flag(CITime) \ diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp index cd3566f193c..1c02e929113 100644 --- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp +++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp @@ -65,10 +65,10 @@ JVMFlag::Error ContendedPaddingWidthConstraintFunc(int value, bool verbose) { } } -JVMFlag::Error PerfDataSamplingIntervalFunc(intx value, bool verbose) { +JVMFlag::Error PerfDataSamplingIntervalFunc(int value, bool verbose) { if ((value % PeriodicTask::interval_gran != 0)) { JVMFlag::printError(verbose, - "PerfDataSamplingInterval (" INTX_FORMAT ") must be " + "PerfDataSamplingInterval (%d) must be " "evenly divisible by PeriodicTask::interval_gran (%d)\n", value, PeriodicTask::interval_gran); return JVMFlag::VIOLATES_CONSTRAINT; diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp index 68cac4bad9c..cbe28456b8a 100644 --- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp +++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp @@ -36,7 +36,7 @@ #define RUNTIME_CONSTRAINTS(f) \ f(int, ObjectAlignmentInBytesConstraintFunc) \ f(int, ContendedPaddingWidthConstraintFunc) \ - f(intx, PerfDataSamplingIntervalFunc) \ + f(int, PerfDataSamplingIntervalFunc) \ f(uintx, VMPageSizeConstraintFunc) \ f(size_t, NUMAInterleaveGranularityConstraintFunc) diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index aeb332586b8..cf721f3de0c 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -443,7 +443,7 @@ const int ObjectAlignmentInBytes = 8; product(bool, LogEvents, true, DIAGNOSTIC, \ "Enable the various ring buffer event logs") \ \ - product(uintx, LogEventsBufferEntries, 20, DIAGNOSTIC, \ + product(int, LogEventsBufferEntries, 20, DIAGNOSTIC, \ "Number of ring buffer event logs") \ range(1, NOT_LP64(1*K) LP64_ONLY(1*M)) \ \ @@ -1101,7 +1101,7 @@ const int ObjectAlignmentInBytes = 8; notproduct(bool, CollectIndexSetStatistics, false, \ "Collect information about IndexSets") \ \ - develop(intx, FastAllocateSizeLimit, 128*K, \ + develop(int, FastAllocateSizeLimit, 128*K, \ /* Note: This value is zero mod 1<<13 for a cheap sparc set. */ \ "Inline allocations larger than this in doublewords must go slow")\ \ @@ -1234,28 +1234,28 @@ const int ObjectAlignmentInBytes = 8; "When using recompilation, never interpret methods " \ "containing loops") \ \ - product(intx, AllocatePrefetchStyle, 1, \ + product(int, AllocatePrefetchStyle, 1, \ "0 = no prefetch, " \ "1 = generate prefetch instructions for each allocation, " \ "2 = use TLAB watermark to gate allocation prefetch, " \ "3 = generate one prefetch instruction per cache line") \ range(0, 3) \ \ - product(intx, AllocatePrefetchDistance, -1, \ + product(int, AllocatePrefetchDistance, -1, \ "Distance to prefetch ahead of allocation pointer. " \ "-1: use system-specific value (automatically determined") \ range(-1, 512) \ \ - product(intx, AllocatePrefetchLines, 3, \ + product(int, AllocatePrefetchLines, 3, \ "Number of lines to prefetch ahead of array allocation pointer") \ range(1, 64) \ \ - product(intx, AllocateInstancePrefetchLines, 1, \ + product(int, AllocateInstancePrefetchLines, 1, \ "Number of lines to prefetch ahead of instance allocation " \ "pointer") \ range(1, 64) \ \ - product(intx, AllocatePrefetchStepSize, 16, \ + product(int, AllocatePrefetchStepSize, 16, \ "Step size in bytes of sequential prefetch instructions") \ range(1, 512) \ constraint(AllocatePrefetchStepSizeConstraintFunc,AfterMemoryInit)\ @@ -1308,7 +1308,7 @@ const int ObjectAlignmentInBytes = 8; develop(intx, MallocCatchPtr, -1, \ "Hit breakpoint when mallocing/freeing this pointer") \ \ - develop(intx, StackPrintLimit, 100, \ + develop(int, StackPrintLimit, 100, \ "number of stack frames to print in VM-level stack dump") \ \ product(int, ErrorLogPrintCodeLimit, 3, DIAGNOSTIC, \ @@ -1742,7 +1742,7 @@ const int ObjectAlignmentInBytes = 8; "The string %p in the file name (if present) " \ "will be replaced by pid") \ \ - product(intx, PerfDataSamplingInterval, 50, \ + product(int, PerfDataSamplingInterval, 50, \ "Data sampling interval (in milliseconds)") \ range(PeriodicTask::min_interval, max_jint) \ constraint(PerfDataSamplingIntervalFunc, AfterErgo) \ diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 0e2a15a71da..7ac99e110d2 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -450,7 +450,7 @@ void VMError::print_native_stack(outputStream* st, frame fr, Thread* t, bool pri // see if it's a valid frame if (fr.pc()) { st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)"); - const int limit = max_frames == -1 ? StackPrintLimit : MIN2(max_frames, (int)StackPrintLimit); + const int limit = max_frames == -1 ? StackPrintLimit : MIN2(max_frames, StackPrintLimit); int count = 0; while (count++ < limit) { fr.print_on_error(st, buf, buf_size); From 207bd00c5101fce06b5ac12e76893d989b0093e2 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 14 Aug 2023 12:08:16 +0000 Subject: [PATCH 037/162] 8313756: [BACKOUT] 8308682: Enhance AES performance Reviewed-by: thartmann --- .../cpu/aarch64/stubGenerator_aarch64.cpp | 48 ++++--------- src/hotspot/cpu/x86/assembler_x86.cpp | 8 --- src/hotspot/cpu/x86/assembler_x86.hpp | 2 - src/hotspot/cpu/x86/macroAssembler_x86.cpp | 11 --- src/hotspot/cpu/x86/macroAssembler_x86.hpp | 3 - src/hotspot/cpu/x86/stubGenerator_x86_64.hpp | 3 +- .../cpu/x86/stubGenerator_x86_64_aes.cpp | 68 ++++++------------- 7 files changed, 37 insertions(+), 106 deletions(-) diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index c08b3c420d7..3fc9c4fdef8 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -2944,23 +2944,6 @@ class StubGenerator: public StubCodeGenerator { return start; } - // Big-endian 128-bit + 64-bit -> 128-bit addition. - // Inputs: 128-bits. in is preserved. - // The least-significant 64-bit word is in the upper dword of each vector. - // inc (the 64-bit increment) is preserved. Its lower dword must be zero. - // Output: result - void be_add_128_64(FloatRegister result, FloatRegister in, - FloatRegister inc, FloatRegister tmp) { - assert_different_registers(result, tmp, inc); - - __ addv(result, __ T2D, in, inc); // Add inc to the least-significant dword of - // input - __ cm(__ HI, tmp, __ T2D, inc, result);// Check for result overflowing - __ ext(tmp, __ T16B, tmp, tmp, 0x08); // Swap LSD of comparison result to MSD and - // MSD == 0 (must be!) to LSD - __ subv(result, __ T2D, result, tmp); // Subtract -1 from MSD if there was an overflow - } - // CTR AES crypt. // Arguments: // @@ -3070,16 +3053,13 @@ class StubGenerator: public StubCodeGenerator { // Setup the counter __ movi(v4, __ T4S, 0); __ movi(v5, __ T4S, 1); - __ ins(v4, __ S, v5, 2, 2); // v4 contains { 0, 1 } + __ ins(v4, __ S, v5, 3, 3); // v4 contains { 0, 0, 0, 1 } - // 128-bit big-endian increment - __ ld1(v0, __ T16B, counter); - __ rev64(v16, __ T16B, v0); - be_add_128_64(v16, v16, v4, /*tmp*/v5); - __ rev64(v16, __ T16B, v16); - __ st1(v16, __ T16B, counter); - // Previous counter value is in v0 - // v4 contains { 0, 1 } + __ ld1(v0, __ T16B, counter); // Load the counter into v0 + __ rev32(v16, __ T16B, v0); + __ addv(v16, __ T4S, v16, v4); + __ rev32(v16, __ T16B, v16); + __ st1(v16, __ T16B, counter); // Save the incremented counter back { // We have fewer than bulk_width blocks of data left. Encrypt @@ -3111,9 +3091,9 @@ class StubGenerator: public StubCodeGenerator { // Increment the counter, store it back __ orr(v0, __ T16B, v16, v16); - __ rev64(v16, __ T16B, v16); - be_add_128_64(v16, v16, v4, /*tmp*/v5); - __ rev64(v16, __ T16B, v16); + __ rev32(v16, __ T16B, v16); + __ addv(v16, __ T4S, v16, v4); + __ rev32(v16, __ T16B, v16); __ st1(v16, __ T16B, counter); // Save the incremented counter back __ b(inner_loop); @@ -3161,7 +3141,7 @@ class StubGenerator: public StubCodeGenerator { // Keys should already be loaded into the correct registers __ ld1(v0, __ T16B, counter); // v0 contains the first counter - __ rev64(v16, __ T16B, v0); // v16 contains byte-reversed counter + __ rev32(v16, __ T16B, v0); // v16 contains byte-reversed counter // AES/CTR loop { @@ -3171,12 +3151,12 @@ class StubGenerator: public StubCodeGenerator { // Setup the counters __ movi(v8, __ T4S, 0); __ movi(v9, __ T4S, 1); - __ ins(v8, __ S, v9, 2, 2); // v8 contains { 0, 1 } + __ ins(v8, __ S, v9, 3, 3); // v8 contains { 0, 0, 0, 1 } for (int i = 0; i < bulk_width; i++) { FloatRegister v0_ofs = as_FloatRegister(v0->encoding() + i); - __ rev64(v0_ofs, __ T16B, v16); - be_add_128_64(v16, v16, v8, /*tmp*/v9); + __ rev32(v0_ofs, __ T16B, v16); + __ addv(v16, __ T4S, v16, v8); } __ ld1(v8, v9, v10, v11, __ T16B, __ post(in, 4 * 16)); @@ -3206,7 +3186,7 @@ class StubGenerator: public StubCodeGenerator { } // Save the counter back where it goes - __ rev64(v16, __ T16B, v16); + __ rev32(v16, __ T16B, v16); __ st1(v16, __ T16B, counter); __ pop(saved_regs, sp); diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index 5d6335691bc..a33d505814d 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -4431,14 +4431,6 @@ void Assembler::evpcmpuw(KRegister kdst, XMMRegister nds, XMMRegister src, Compa emit_int24(0x3E, (0xC0 | encode), vcc); } -void Assembler::evpcmpuq(KRegister kdst, XMMRegister nds, XMMRegister src, ComparisonPredicate vcc, int vector_len) { - assert(VM_Version::supports_avx512vl(), ""); - InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); - attributes.set_is_evex_instruction(); - int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); - emit_int24(0x1E, (0xC0 | encode), vcc); -} - void Assembler::evpcmpuw(KRegister kdst, XMMRegister nds, Address src, ComparisonPredicate vcc, int vector_len) { assert(VM_Version::supports_avx512vlbw(), ""); InstructionMark im(this); diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index b86bea3805e..25101c0f052 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -1806,8 +1806,6 @@ class Assembler : public AbstractAssembler { void evpcmpuw(KRegister kdst, XMMRegister nds, XMMRegister src, ComparisonPredicate vcc, int vector_len); void evpcmpuw(KRegister kdst, XMMRegister nds, Address src, ComparisonPredicate vcc, int vector_len); - void evpcmpuq(KRegister kdst, XMMRegister nds, XMMRegister src, ComparisonPredicate vcc, int vector_len); - void pcmpeqw(XMMRegister dst, XMMRegister src); void vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void evpcmpeqw(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len); diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 709818f391e..87e6640c1b3 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -9257,17 +9257,6 @@ void MacroAssembler::evpandq(XMMRegister dst, XMMRegister nds, AddressLiteral sr } } -void MacroAssembler::evpaddq(XMMRegister dst, KRegister mask, XMMRegister nds, AddressLiteral src, bool merge, int vector_len, Register rscratch) { - assert(rscratch != noreg || always_reachable(src), "missing"); - - if (reachable(src)) { - Assembler::evpaddq(dst, mask, nds, as_Address(src), merge, vector_len); - } else { - lea(rscratch, src); - Assembler::evpaddq(dst, mask, nds, Address(rscratch, 0), merge, vector_len); - } -} - void MacroAssembler::evporq(XMMRegister dst, XMMRegister nds, AddressLiteral src, int vector_len, Register rscratch) { assert(rscratch != noreg || always_reachable(src), "missing"); diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index 5c7175e8ab6..2ef6677281c 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -1788,9 +1788,6 @@ class MacroAssembler: public Assembler { using Assembler::evpandq; void evpandq(XMMRegister dst, XMMRegister nds, AddressLiteral src, int vector_len, Register rscratch = noreg); - using Assembler::evpaddq; - void evpaddq(XMMRegister dst, KRegister mask, XMMRegister nds, AddressLiteral src, bool merge, int vector_len, Register rscratch = noreg); - using Assembler::evporq; void evporq(XMMRegister dst, XMMRegister nds, AddressLiteral src, int vector_len, Register rscratch = noreg); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp index d65d8e871c3..be3a5f0ea0f 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp @@ -364,8 +364,7 @@ class StubGenerator: public StubCodeGenerator { // Utility routine for increase 128bit counter (iv in CTR mode) void inc_counter(Register reg, XMMRegister xmmdst, int inc_delta, Label& next_block); - void ev_add128(XMMRegister xmmdst, XMMRegister xmmsrc1, XMMRegister xmmsrc2, - int vector_len, KRegister ktmp, Register rscratch = noreg); + void generate_aes_stubs(); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp index 7b1fb54853e..3e1439f2a02 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp @@ -121,16 +121,6 @@ static address counter_mask_linc32_addr() { return (address)COUNTER_MASK_LINC32; } -ATTRIBUTE_ALIGNED(64) uint64_t COUNTER_MASK_ONES[] = { - 0x0000000000000000UL, 0x0000000000000001UL, - 0x0000000000000000UL, 0x0000000000000001UL, - 0x0000000000000000UL, 0x0000000000000001UL, - 0x0000000000000000UL, 0x0000000000000001UL, -}; -static address counter_mask_ones_addr() { - return (address)COUNTER_MASK_ONES; -} - ATTRIBUTE_ALIGNED(64) static const uint64_t GHASH_POLYNOMIAL_REDUCTION[] = { 0x00000001C2000000UL, 0xC200000000000000UL, 0x00000001C2000000UL, 0xC200000000000000UL, @@ -1633,17 +1623,6 @@ void StubGenerator::ev_load_key(XMMRegister xmmdst, Register key, int offset, Re __ evshufi64x2(xmmdst, xmmdst, xmmdst, 0x0, Assembler::AVX_512bit); } -// Add 128-bit integers in xmmsrc1 to xmmsrc2, then place the result in xmmdst. -// Clobber ktmp and rscratch. -// Used by aesctr_encrypt. -void StubGenerator::ev_add128(XMMRegister xmmdst, XMMRegister xmmsrc1, XMMRegister xmmsrc2, - int vector_len, KRegister ktmp, Register rscratch) { - __ vpaddq(xmmdst, xmmsrc1, xmmsrc2, vector_len); - __ evpcmpuq(ktmp, xmmdst, xmmsrc2, __ lt, vector_len); - __ kshiftlbl(ktmp, ktmp, 1); - __ evpaddq(xmmdst, ktmp, xmmdst, ExternalAddress(counter_mask_ones_addr()), /*merge*/true, - vector_len, rscratch); -} // AES-ECB Encrypt Operation void StubGenerator::aesecb_encrypt(Register src_addr, Register dest_addr, Register key, Register len) { @@ -2067,6 +2046,7 @@ void StubGenerator::aesecb_decrypt(Register src_addr, Register dest_addr, Regist } + // AES Counter Mode using VAES instructions void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Register key, Register counter, Register len_reg, Register used, Register used_addr, Register saved_encCounter_start) { @@ -2124,17 +2104,14 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist // The counter is incremented after each block i.e. 16 bytes is processed; // each zmm register has 4 counter values as its MSB // the counters are incremented in parallel - - __ evmovdquq(xmm19, ExternalAddress(counter_mask_linc0_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); - ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); - __ evmovdquq(xmm19, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); - ev_add128(xmm9, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); - ev_add128(xmm10, xmm9, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); - ev_add128(xmm11, xmm10, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); - ev_add128(xmm12, xmm11, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); - ev_add128(xmm13, xmm12, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); - ev_add128(xmm14, xmm13, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); - ev_add128(xmm15, xmm14, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddd(xmm8, xmm8, ExternalAddress(counter_mask_linc0_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + __ vpaddd(xmm9, xmm8, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + __ vpaddd(xmm10, xmm9, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + __ vpaddd(xmm11, xmm10, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + __ vpaddd(xmm12, xmm11, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + __ vpaddd(xmm13, xmm12, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + __ vpaddd(xmm14, xmm13, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + __ vpaddd(xmm15, xmm14, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); // load linc32 mask in zmm register.linc32 increments counter by 32 __ evmovdquq(xmm19, ExternalAddress(counter_mask_linc32_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); @@ -2182,21 +2159,21 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist // This is followed by incrementing counter values in zmm8-zmm15. // Since we will be processing 32 blocks at a time, the counter is incremented by 32. roundEnc(xmm21, 7); - ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_512bit); roundEnc(xmm22, 7); - ev_add128(xmm9, xmm9, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm9, xmm9, xmm19, Assembler::AVX_512bit); roundEnc(xmm23, 7); - ev_add128(xmm10, xmm10, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm10, xmm10, xmm19, Assembler::AVX_512bit); roundEnc(xmm24, 7); - ev_add128(xmm11, xmm11, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm11, xmm11, xmm19, Assembler::AVX_512bit); roundEnc(xmm25, 7); - ev_add128(xmm12, xmm12, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm12, xmm12, xmm19, Assembler::AVX_512bit); roundEnc(xmm26, 7); - ev_add128(xmm13, xmm13, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm13, xmm13, xmm19, Assembler::AVX_512bit); roundEnc(xmm27, 7); - ev_add128(xmm14, xmm14, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm14, xmm14, xmm19, Assembler::AVX_512bit); roundEnc(xmm28, 7); - ev_add128(xmm15, xmm15, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm15, xmm15, xmm19, Assembler::AVX_512bit); roundEnc(xmm29, 7); __ cmpl(rounds, 52); @@ -2274,8 +2251,8 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist __ vpshufb(xmm3, xmm11, xmm16, Assembler::AVX_512bit); __ evpxorq(xmm3, xmm3, xmm20, Assembler::AVX_512bit); // Increment counter values by 16 - ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); - ev_add128(xmm9, xmm9, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_512bit); + __ vpaddq(xmm9, xmm9, xmm19, Assembler::AVX_512bit); // AES encode rounds roundEnc(xmm21, 3); roundEnc(xmm22, 3); @@ -2342,7 +2319,7 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist __ vpshufb(xmm1, xmm9, xmm16, Assembler::AVX_512bit); __ evpxorq(xmm1, xmm1, xmm20, Assembler::AVX_512bit); // increment counter by 8 - ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_512bit); // AES encode roundEnc(xmm21, 1); roundEnc(xmm22, 1); @@ -2399,9 +2376,8 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist // XOR counter with first roundkey __ vpshufb(xmm0, xmm8, xmm16, Assembler::AVX_512bit); __ evpxorq(xmm0, xmm0, xmm20, Assembler::AVX_512bit); - // Increment counter - ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_512bit); __ vaesenc(xmm0, xmm0, xmm21, Assembler::AVX_512bit); __ vaesenc(xmm0, xmm0, xmm22, Assembler::AVX_512bit); __ vaesenc(xmm0, xmm0, xmm23, Assembler::AVX_512bit); @@ -2451,7 +2427,7 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist __ evpxorq(xmm0, xmm0, xmm20, Assembler::AVX_128bit); __ vaesenc(xmm0, xmm0, xmm21, Assembler::AVX_128bit); // Increment counter by 1 - ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_128bit, /*ktmp*/k1, r15 /*rscratch*/); + __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_128bit); __ vaesenc(xmm0, xmm0, xmm22, Assembler::AVX_128bit); __ vaesenc(xmm0, xmm0, xmm23, Assembler::AVX_128bit); __ vaesenc(xmm0, xmm0, xmm24, Assembler::AVX_128bit); From 6574dd796dbb23645c87dddad427ed8f26d18323 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Mon, 14 Aug 2023 13:38:22 +0000 Subject: [PATCH 038/162] 8314025: Remove JUnit-based test in java/lang/invoke from problem list Reviewed-by: dholmes, jpai --- test/jdk/ProblemList.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 3b266fee462..24655fcb8c0 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -478,8 +478,6 @@ java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java 8151492 generic- java/lang/invoke/LFCaching/LFGarbageCollectedTest.java 8078602 generic-all java/lang/invoke/lambda/LambdaFileEncodingSerialization.java 8249079 linux-x64 java/lang/invoke/RicochetTest.java 8251969 generic-all -java/lang/invoke/MethodHandleProxies/BasicTest.java 8312482 linux-all -java/lang/invoke/MethodHandleProxies/WrapperHiddenClassTest.java 8312482 linux-all ############################################################################ From 911d1dbbf7362693c736b905b42e5150fc4f8a96 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Mon, 14 Aug 2023 15:37:44 +0000 Subject: [PATCH 039/162] 8314078: HotSpotConstantPool.lookupField() asserts due to field changes in ConstantPool.cpp Reviewed-by: dnsimon, coleenp --- src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 9 +++ .../jdk/vm/ci/hotspot/CompilerToVM.java | 26 +++++-- .../vm/ci/hotspot/HotSpotConstantPool.java | 76 ++++++++++--------- .../classes/jdk/vm/ci/meta/ConstantPool.java | 41 +++++----- .../vm/ci/runtime/test/ConstantPoolTest.java | 32 +++++++- 5 files changed, 123 insertions(+), 61 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index 0b6a821b74b..e5b62375d2a 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -1620,6 +1620,14 @@ C2V_VMENTRY_0(int, decodeIndyIndexToCPIndex, (JNIEnv* env, jobject, ARGUMENT_PAI return cp->resolved_indy_entry_at(indy_index)->constant_pool_index(); C2V_END +C2V_VMENTRY_0(int, decodeFieldIndexToCPIndex, (JNIEnv* env, jobject, ARGUMENT_PAIR(cp), jint field_index)) + constantPoolHandle cp(THREAD, UNPACK_PAIR(ConstantPool, cp)); + if (field_index < 0 || field_index >= cp->resolved_field_entries_length()) { + JVMCI_THROW_MSG_0(IllegalStateException, err_msg("invalid field index %d", field_index)); + } + return cp->resolved_field_entry_at(field_index)->constant_pool_index(); +C2V_END + C2V_VMENTRY(void, resolveInvokeHandleInPool, (JNIEnv* env, jobject, ARGUMENT_PAIR(cp), jint index)) constantPoolHandle cp(THREAD, UNPACK_PAIR(ConstantPool, cp)); Klass* holder = cp->klass_ref_at(index, Bytecodes::_invokehandle, CHECK); @@ -3143,6 +3151,7 @@ JNINativeMethod CompilerToVM::methods[] = { {CC "getUncachedStringInPool", CC "(" HS_CONSTANT_POOL2 "I)" JAVACONSTANT, FN_PTR(getUncachedStringInPool)}, {CC "resolveTypeInPool", CC "(" HS_CONSTANT_POOL2 "I)" HS_KLASS, FN_PTR(resolveTypeInPool)}, {CC "resolveFieldInPool", CC "(" HS_CONSTANT_POOL2 "I" HS_METHOD2 "B[I)" HS_KLASS, FN_PTR(resolveFieldInPool)}, + {CC "decodeFieldIndexToCPIndex", CC "(" HS_CONSTANT_POOL2 "I)I", FN_PTR(decodeFieldIndexToCPIndex)}, {CC "decodeIndyIndexToCPIndex", CC "(" HS_CONSTANT_POOL2 "IZ)I", FN_PTR(decodeIndyIndexToCPIndex)}, {CC "resolveInvokeHandleInPool", CC "(" HS_CONSTANT_POOL2 "I)V", FN_PTR(resolveInvokeHandleInPool)}, {CC "isResolvedInvokeHandleInPool", CC "(" HS_CONSTANT_POOL2 "I)I", FN_PTR(isResolvedInvokeHandleInPool)}, diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java index 59f9cf1b129..ed96bd03597 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java @@ -435,6 +435,19 @@ int decodeIndyIndexToCPIndex(HotSpotConstantPool constantPool, int encoded_indy_ private native int decodeIndyIndexToCPIndex(HotSpotConstantPool constantPool, long constantPoolPointer, int encoded_indy_index, boolean resolve); + /** + * Converts the {@code rawIndex} operand of a rewritten getfield/putfield/getstatic/putstatic instruction + * to an index directly into {@code constantPool}. + * + * @throws IllegalArgumentException if {@code rawIndex} is out of range. + * @return {@code JVM_CONSTANT_FieldRef} constant pool entry index for the invokedynamic + */ + int decodeFieldIndexToCPIndex(HotSpotConstantPool constantPool, int rawIndex) { + return decodeFieldIndexToCPIndex(constantPool, constantPool.getConstantPoolPointer(), rawIndex); + } + + private native int decodeFieldIndexToCPIndex(HotSpotConstantPool constantPool, long constantPoolPointer, int rawIndex); + /** * Resolves the details for invoking the bootstrap method associated with the * {@code CONSTANT_Dynamic_info} or @{code CONSTANT_InvokeDynamic_info} entry at {@code cpi} in @@ -507,8 +520,8 @@ HotSpotResolvedObjectTypeImpl resolveTypeInPool(HotSpotConstantPool constantPool private native HotSpotResolvedObjectTypeImpl resolveTypeInPool(HotSpotConstantPool constantPool, long constantPoolPointer, int cpi) throws LinkageError; /** - * Looks up and attempts to resolve the {@code JVM_CONSTANT_Field} entry for at index - * {@code cpi} in {@code constantPool}. For some opcodes, checks are performed that require the + * Looks up and attempts to resolve the {@code JVM_CONSTANT_Field} entry denoted by + * {@code rawIndex}. For some opcodes, checks are performed that require the * {@code method} that contains {@code opcode} to be specified. The values returned in * {@code info} are: * @@ -520,19 +533,18 @@ HotSpotResolvedObjectTypeImpl resolveTypeInPool(HotSpotConstantPool constantPool * ] * * - * The behavior of this method is undefined if {@code cpi} does not denote a - * {@code JVM_CONSTANT_Field} entry. + * The behavior of this method is undefined if {@code rawIndex} is invalid. * * @param info an array in which the details of the field are returned * @return the type defining the field if resolution is successful, null otherwise */ - HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, int cpi, HotSpotResolvedJavaMethodImpl method, byte opcode, int[] info) { + HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, int rawIndex, HotSpotResolvedJavaMethodImpl method, byte opcode, int[] info) { long methodPointer = method != null ? method.getMethodPointer() : 0L; - return resolveFieldInPool(constantPool, constantPool.getConstantPoolPointer(), cpi, method, methodPointer, opcode, info); + return resolveFieldInPool(constantPool, constantPool.getConstantPoolPointer(), rawIndex, method, methodPointer, opcode, info); } private native HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, long constantPoolPointer, - int cpi, HotSpotResolvedJavaMethodImpl method, long methodPointer, byte opcode, int[] info); + int rawIndex, HotSpotResolvedJavaMethodImpl method, long methodPointer, byte opcode, int[] info); /** * Converts {@code cpci} from an index into the cache for {@code constantPool} to an index diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java index 390becd4179..bc81d77138a 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java @@ -260,14 +260,10 @@ private static int rawIndexToConstantPoolCacheIndex(int rawIndex, int opcode) { throw new IllegalArgumentException("not an invokedynamic constant pool index " + index); } } else { - if (opcode == Bytecodes.GETFIELD || - opcode == Bytecodes.PUTFIELD || - opcode == Bytecodes.GETSTATIC || - opcode == Bytecodes.PUTSTATIC || - opcode == Bytecodes.INVOKEINTERFACE || - opcode == Bytecodes.INVOKEVIRTUAL || - opcode == Bytecodes.INVOKESPECIAL || - opcode == Bytecodes.INVOKESTATIC) { + if (opcode == Bytecodes.INVOKEINTERFACE || + opcode == Bytecodes.INVOKEVIRTUAL || + opcode == Bytecodes.INVOKESPECIAL || + opcode == Bytecodes.INVOKESTATIC) { index = rawIndex + config().constantPoolCpCacheIndexTag; } else { throw new IllegalArgumentException("unexpected opcode " + opcode); @@ -748,8 +744,8 @@ public JavaType lookupType(int cpi, int opcode) { } @Override - public JavaType lookupReferencedType(int cpi, int opcode) { - int index; + public JavaType lookupReferencedType(int rawIndex, int opcode) { + int cpi; switch (opcode) { case Bytecodes.CHECKCAST: case Bytecodes.INSTANCEOF: @@ -759,43 +755,45 @@ public JavaType lookupReferencedType(int cpi, int opcode) { case Bytecodes.LDC: case Bytecodes.LDC_W: case Bytecodes.LDC2_W: - index = cpi; + cpi = rawIndex; break; case Bytecodes.GETSTATIC: case Bytecodes.PUTSTATIC: case Bytecodes.GETFIELD: case Bytecodes.PUTFIELD: + cpi = getKlassRefIndexAt(rawIndex, opcode); + break; case Bytecodes.INVOKEVIRTUAL: case Bytecodes.INVOKESPECIAL: case Bytecodes.INVOKESTATIC: case Bytecodes.INVOKEINTERFACE: { - index = rawIndexToConstantPoolCacheIndex(cpi, opcode); - index = getKlassRefIndexAt(index, opcode); + int cpci = rawIndexToConstantPoolCacheIndex(rawIndex, opcode); + cpi = getKlassRefIndexAt(cpci, opcode); break; } default: throw JVMCIError.shouldNotReachHere("Unexpected opcode " + opcode); } - final Object type = compilerToVM().lookupKlassInPool(this, index); + final Object type = compilerToVM().lookupKlassInPool(this, cpi); return getJavaType(type); } @Override - public JavaField lookupField(int cpi, ResolvedJavaMethod method, int opcode) { - final int index = rawIndexToConstantPoolCacheIndex(cpi, opcode); - final int nameAndTypeIndex = getNameAndTypeRefIndexAt(index, opcode); + public JavaField lookupField(int rawIndex, ResolvedJavaMethod method, int opcode) { + final int cpi = compilerToVM().decodeFieldIndexToCPIndex(this, rawIndex); + final int nameAndTypeIndex = getNameAndTypeRefIndexAt(rawIndex, opcode); final int typeIndex = getSignatureRefIndexAt(nameAndTypeIndex); String typeName = lookupUtf8(typeIndex); JavaType type = runtime().lookupType(typeName, getHolder(), false); - final int holderIndex = getKlassRefIndexAt(index, opcode); + final int holderIndex = getKlassRefIndexAt(rawIndex, opcode); JavaType fieldHolder = lookupType(holderIndex, opcode); if (fieldHolder instanceof HotSpotResolvedObjectTypeImpl) { int[] info = new int[4]; HotSpotResolvedObjectTypeImpl resolvedHolder; try { - resolvedHolder = compilerToVM().resolveFieldInPool(this, index, (HotSpotResolvedJavaMethodImpl) method, (byte) opcode, info); + resolvedHolder = compilerToVM().resolveFieldInPool(this, rawIndex, (HotSpotResolvedJavaMethodImpl) method, (byte) opcode, info); } catch (Throwable t) { /* * If there was an exception resolving the field we give up and return an unresolved @@ -833,19 +831,25 @@ public int rawIndexToConstantPoolIndex(int rawIndex, int opcode) { if (opcode == Bytecodes.INVOKEDYNAMIC) { throw new IllegalArgumentException("unexpected INVOKEDYNAMIC at " + rawIndex); } + if (opcode == Bytecodes.GETSTATIC || + opcode == Bytecodes.PUTSTATIC || + opcode == Bytecodes.GETFIELD || + opcode == Bytecodes.PUTFIELD) { + return compilerToVM().decodeFieldIndexToCPIndex(this, rawIndex); + } int index = rawIndexToConstantPoolCacheIndex(rawIndex, opcode); return compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index); } @Override - public void loadReferencedType(int cpi, int opcode) { - loadReferencedType(cpi, opcode, true /* initialize */); + public void loadReferencedType(int rawIndex, int opcode) { + loadReferencedType(rawIndex, opcode, true /* initialize */); } @Override @SuppressWarnings("fallthrough") - public void loadReferencedType(int cpi, int opcode, boolean initialize) { - int index; + public void loadReferencedType(int rawIndex, int opcode, boolean initialize) { + int cpi; switch (opcode) { case Bytecodes.CHECKCAST: case Bytecodes.INSTANCEOF: @@ -855,57 +859,59 @@ public void loadReferencedType(int cpi, int opcode, boolean initialize) { case Bytecodes.LDC: case Bytecodes.LDC_W: case Bytecodes.LDC2_W: - index = cpi; + cpi = rawIndex; break; case Bytecodes.INVOKEDYNAMIC: { // invokedynamic indices are different from constant pool cache indices - if (!isInvokedynamicIndex(cpi)) { - throw new IllegalArgumentException("must use invokedynamic index but got " + cpi); + if (!isInvokedynamicIndex(rawIndex)) { + throw new IllegalArgumentException("must use invokedynamic index but got " + rawIndex); } - index = compilerToVM().decodeIndyIndexToCPIndex(this, cpi, true); + cpi = compilerToVM().decodeIndyIndexToCPIndex(this, rawIndex, true); break; } case Bytecodes.GETSTATIC: case Bytecodes.PUTSTATIC: case Bytecodes.GETFIELD: case Bytecodes.PUTFIELD: + cpi = compilerToVM().decodeFieldIndexToCPIndex(this, rawIndex); + break; case Bytecodes.INVOKEVIRTUAL: case Bytecodes.INVOKESPECIAL: case Bytecodes.INVOKESTATIC: case Bytecodes.INVOKEINTERFACE: { // invoke and field instructions point to a constant pool cache entry. - index = rawIndexToConstantPoolCacheIndex(cpi, opcode); - index = compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index); + int cpci = rawIndexToConstantPoolCacheIndex(rawIndex, opcode); + cpi = compilerToVM().constantPoolRemapInstructionOperandFromCache(this, cpci); break; } default: throw JVMCIError.shouldNotReachHere("Unexpected opcode " + opcode); } - final JvmConstant tag = getTagAt(index); + final JvmConstant tag = getTagAt(cpi); if (tag == null) { - assert getTagAt(index - 1) == constants.jvmDouble || getTagAt(index - 1) == constants.jvmLong; + assert getTagAt(cpi - 1) == constants.jvmDouble || getTagAt(cpi - 1) == constants.jvmLong; return; } switch (tag.name) { case "Methodref": case "Fieldref": case "InterfaceMethodref": - index = getUncachedKlassRefIndexAt(index); + cpi = getUncachedKlassRefIndexAt(cpi); // Read the tag only once because it could change between multiple reads. - final JvmConstant klassTag = getTagAt(index); + final JvmConstant klassTag = getTagAt(cpi); assert klassTag == constants.jvmClass || klassTag == constants.jvmUnresolvedClass || klassTag == constants.jvmUnresolvedClassInError : klassTag; // fall through case "Class": case "UnresolvedClass": case "UnresolvedClassInError": - final HotSpotResolvedObjectTypeImpl type = compilerToVM().resolveTypeInPool(this, index); + final HotSpotResolvedObjectTypeImpl type = compilerToVM().resolveTypeInPool(this, cpi); if (initialize && !type.isPrimitive() && !type.isArray()) { type.ensureInitialized(); } if (tag == constants.jvmMethodref) { if (Bytecodes.isInvokeHandleAlias(opcode) && isSignaturePolymorphicHolder(type)) { - final int methodRefCacheIndex = rawIndexToConstantPoolCacheIndex(cpi, opcode); + final int methodRefCacheIndex = rawIndexToConstantPoolCacheIndex(rawIndex, opcode); checkTag(compilerToVM().constantPoolRemapInstructionOperandFromCache(this, methodRefCacheIndex), constants.jvmMethodref); compilerToVM().resolveInvokeHandleInPool(this, methodRefCacheIndex); } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java index 7c7cfb5687f..44cd1bc0d48 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,14 @@ * Represents the runtime representation of the constant pool that is used by the compiler when * parsing bytecode. Provides methods to look up a constant pool entry without performing * resolution. They are used during compilation. + * + * The following convention is used when accessing the ConstantPool with an index: + *

    + *
  • rawIndex - index in the bytecode stream after the opcode (could be rewritten for some opcodes)
  • + *
  • cpi - the constant pool index (as specified in JVM Spec)
  • + *
+ * + * Some of the methods are currently not using the convention correctly. That will be addressed in JDK-8314172. */ public interface ConstantPool { @@ -44,53 +52,50 @@ public interface ConstantPool { * initialized. This can be used to compile time resolve a type. It works for field, method, or * type constant pool entries. * - * @param cpi the index of the constant pool entry that references the type + * @param rawIndex index in the bytecode stream after the {@code opcode} (could be rewritten for some opcodes) * @param opcode the opcode of the instruction that references the type */ - void loadReferencedType(int cpi, int opcode); + void loadReferencedType(int rawIndex, int opcode); /** * Ensures that the type referenced by the specified constant pool entry is loaded. This can be * used to compile time resolve a type. It works for field, method, or type constant pool * entries. * - * @param cpi the index of the constant pool entry that references the type + * @param rawIndex index in the bytecode stream after the {@code opcode} (could be rewritten for some opcodes) * @param opcode the opcode of the instruction that references the type * @param initialize if {@code true}, the referenced type is either guaranteed to be initialized * upon return or an initialization exception is thrown */ - default void loadReferencedType(int cpi, int opcode, boolean initialize) { + default void loadReferencedType(int rawIndex, int opcode, boolean initialize) { if (initialize) { - loadReferencedType(cpi, opcode); + loadReferencedType(rawIndex, opcode); } else { throw new UnsupportedOperationException(); } } /** - * Looks up the type referenced by the constant pool entry at {@code cpi} as referenced by the - * {@code opcode} bytecode instruction. + * Looks up the type referenced by the {@code rawIndex}. * - * @param cpi the index of a constant pool entry that references a type - * @param opcode the opcode of the instruction with {@code cpi} as an operand + * @param rawIndex index in the bytecode stream after the {@code opcode} (could be rewritten for some opcodes) + * @param opcode the opcode of the instruction with {@code rawIndex} as an operand * @return a reference to the compiler interface type */ - JavaType lookupReferencedType(int cpi, int opcode); + JavaType lookupReferencedType(int rawIndex, int opcode); /** - * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks + * Looks up a reference to a field. Resolution checks * specific to the bytecode it denotes are performed if the field is already resolved. Checks * for some bytecodes require the method that contains the bytecode to be specified. Should any * of these checks fail, an unresolved field reference is returned. * - * @param cpi the constant pool index - * @param opcode the opcode of the instruction for which the lookup is being performed or - * {@code -1} + * @param rawIndex rewritten index in the bytecode stream after the {@code opcode} + * @param opcode the opcode of the instruction for which the lookup is being performed * @param method the method for which the lookup is being performed - * @return a reference to the field at {@code cpi} in this pool - * @throws ClassFormatError if the entry at {@code cpi} is not a field + * @return a reference to the field at {@code rawIndex} in this pool */ - JavaField lookupField(int cpi, ResolvedJavaMethod method, int opcode); + JavaField lookupField(int rawIndex, ResolvedJavaMethod method, int opcode); /** * Looks up a reference to a method. If {@code opcode} is non-negative, then resolution checks diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantPoolTest.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantPoolTest.java index 2fb53b38256..1241c33f24b 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantPoolTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantPoolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,10 +40,12 @@ import org.testng.Assert; import org.testng.annotations.Test; +import jdk.vm.ci.meta.JavaField; import jdk.vm.ci.meta.JavaMethod; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.vm.ci.meta.Signature; import jdk.vm.ci.runtime.JVMCI; public class ConstantPoolTest { @@ -81,6 +83,7 @@ static Object cloneObjectArray(Object[] arr) { } public static final int ALOAD_0 = 42; // 0x2A + public static final int GETSTATIC = 178; // 0xB2 public static final int INVOKEVIRTUAL = 182; // 0xB6 public static int beU2(byte[] data, int bci) { @@ -108,4 +111,31 @@ public void lookupArrayCloneMethodTest() throws Exception { } } } + + static int someStaticField = 1; + static int getStaticField() { + return someStaticField; + } + + @Test + public void lookupFieldTest() throws Exception { + MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess(); + ResolvedJavaType type = metaAccess.lookupJavaType(ConstantPoolTest.class); + + String methodName = "getStaticField"; + Signature methodSig = metaAccess.parseMethodDescriptor("()I"); + ResolvedJavaMethod m = type.findMethod(methodName, methodSig); + Assert.assertNotNull(m); + + // Expected: + // 0: getstatic "someStaticField":"I"; + // 3: ireturn; + byte[] bytecode = m.getCode(); + Assert.assertNotNull(bytecode); + Assert.assertEquals(4, bytecode.length); + Assert.assertEquals(GETSTATIC, beU1(bytecode, 0)); + int rawIndex = beU2(bytecode, 1); + JavaField field = m.getConstantPool().lookupField(rawIndex, m, GETSTATIC); + Assert.assertEquals("someStaticField", field.getName(), "Wrong field name; rawIndex = " + rawIndex + ";"); + } } From f41c267f859c305a2d01c629dbc56692322f81e2 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Mon, 14 Aug 2023 15:51:18 +0000 Subject: [PATCH 040/162] 8314045: ArithmeticException in GaloisCounterMode Co-authored-by: Ioana Nedelcu Reviewed-by: ascarpino --- .../crypto/provider/GaloisCounterMode.java | 7 +++ .../provider/Cipher/AEAD/GCMShortInput.java | 58 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortInput.java diff --git a/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java b/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java index f676c4dd1a6..03b481af6c2 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java @@ -1572,6 +1572,13 @@ public int doFinal(ByteBuffer src, ByteBuffer dst) len += buffer.remaining(); } + // Check that input data is long enough to fit the expected tag. + if (len < 0) { + throw new AEADBadTagException("Input data too short to " + + "contain an expected tag length of " + tagLenBytes + + "bytes"); + } + checkDataLength(len); // Verify dst is large enough diff --git a/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortInput.java b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortInput.java new file mode 100644 index 00000000000..d01cbfb1e19 --- /dev/null +++ b/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortInput.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023, Alphabet LLC. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8314045 + * @summary ArithmeticException in GaloisCounterMode + */ + +import java.nio.ByteBuffer; + +import javax.crypto.AEADBadTagException; +import javax.crypto.Cipher; +import javax.crypto.spec.GCMParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +public class GCMShortInput { + + public static void main(String args[]) throws Exception { + SecretKeySpec keySpec = + new SecretKeySpec( + new byte[] { + 88, 26, 43, -100, -24, -29, -70, 10, 34, -85, 52, 101, 45, -68, -105, + -123 + }, + "AES"); + GCMParameterSpec params = + new GCMParameterSpec(8 * 16, new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); + Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); + cipher.init(Cipher.DECRYPT_MODE, keySpec, params); + try { + cipher.doFinal(ByteBuffer.allocate(0), ByteBuffer.allocate(0)); + throw new AssertionError("AEADBadTagException expected"); + } catch (AEADBadTagException e) { + // expected + } + } +} From 4b2703ad39f8160264eb30c797824cc93a6b56e2 Mon Sep 17 00:00:00 2001 From: Oli Gillespie Date: Mon, 14 Aug 2023 15:58:03 +0000 Subject: [PATCH 041/162] 8313678: SymbolTable can leak Symbols during cleanup Reviewed-by: coleenp, dholmes, shade --- src/hotspot/share/classfile/dictionary.cpp | 6 ++++-- src/hotspot/share/classfile/stringTable.cpp | 17 +++++++++++------ src/hotspot/share/classfile/symbolTable.cpp | 11 ++++++++--- src/hotspot/share/gc/g1/g1CardSet.cpp | 7 +++++-- src/hotspot/share/prims/resolvedMethodTable.cpp | 8 +++++--- src/hotspot/share/services/finalizerService.cpp | 5 ++++- src/hotspot/share/services/threadIdTable.cpp | 5 ++++- .../utilities/concurrentHashTable.inline.hpp | 12 ++++-------- .../gtest/classfile/test_symbolTable.cpp | 14 ++++++++++++++ .../utilities/test_concurrentHashtable.cpp | 10 ++++++++-- .../dynamicArchive/DynamicSharedSymbols.java | 2 +- 11 files changed, 68 insertions(+), 29 deletions(-) diff --git a/src/hotspot/share/classfile/dictionary.cpp b/src/hotspot/share/classfile/dictionary.cpp index f60d426f5fb..f1f02e11d81 100644 --- a/src/hotspot/share/classfile/dictionary.cpp +++ b/src/hotspot/share/classfile/dictionary.cpp @@ -229,11 +229,13 @@ class DictionaryLookup : StackObj { uintx get_hash() const { return _name->identity_hash(); } - bool equals(DictionaryEntry** value, bool* is_dead) { + bool equals(DictionaryEntry** value) { DictionaryEntry *entry = *value; - *is_dead = false; return (entry->instance_klass()->name() == _name); } + bool is_dead(DictionaryEntry** value) { + return false; + } }; // Add a loaded class to the dictionary. diff --git a/src/hotspot/share/classfile/stringTable.cpp b/src/hotspot/share/classfile/stringTable.cpp index 2751148dff3..66b9ca4ff02 100644 --- a/src/hotspot/share/classfile/stringTable.cpp +++ b/src/hotspot/share/classfile/stringTable.cpp @@ -176,11 +176,9 @@ class StringTableLookupJchar : StackObj { uintx get_hash() const { return _hash; } - bool equals(WeakHandle* value, bool* is_dead) { + bool equals(WeakHandle* value) { oop val_oop = value->peek(); if (val_oop == nullptr) { - // dead oop, mark this hash dead for cleaning - *is_dead = true; return false; } bool equals = java_lang_String::equals(val_oop, _str, _len); @@ -191,6 +189,10 @@ class StringTableLookupJchar : StackObj { _found = Handle(_thread, value->resolve()); return true; } + bool is_dead(WeakHandle* value) { + oop val_oop = value->peek(); + return val_oop == nullptr; + } }; class StringTableLookupOop : public StackObj { @@ -208,11 +210,9 @@ class StringTableLookupOop : public StackObj { return _hash; } - bool equals(WeakHandle* value, bool* is_dead) { + bool equals(WeakHandle* value) { oop val_oop = value->peek(); if (val_oop == nullptr) { - // dead oop, mark this hash dead for cleaning - *is_dead = true; return false; } bool equals = java_lang_String::equals(_find(), val_oop); @@ -223,6 +223,11 @@ class StringTableLookupOop : public StackObj { _found = Handle(_thread, value->resolve()); return true; } + + bool is_dead(WeakHandle* value) { + oop val_oop = value->peek(); + return val_oop == nullptr; + } }; void StringTable::create_table() { diff --git a/src/hotspot/share/classfile/symbolTable.cpp b/src/hotspot/share/classfile/symbolTable.cpp index a6fb48ac547..6162be7c0fe 100644 --- a/src/hotspot/share/classfile/symbolTable.cpp +++ b/src/hotspot/share/classfile/symbolTable.cpp @@ -374,7 +374,11 @@ class SymbolTableLookup : StackObj { uintx get_hash() const { return _hash; } - bool equals(Symbol* value, bool* is_dead) { + // Note: When equals() returns "true", the symbol's refcount is incremented. This is + // needed to ensure that the symbol is kept alive before equals() returns to the caller, + // so that another thread cannot clean the symbol up concurrently. The caller is + // responsible for decrementing the refcount, when the symbol is no longer needed. + bool equals(Symbol* value) { assert(value != nullptr, "expected valid value"); Symbol *sym = value; if (sym->equals(_str, _len)) { @@ -383,14 +387,15 @@ class SymbolTableLookup : StackObj { return true; } else { assert(sym->refcount() == 0, "expected dead symbol"); - *is_dead = true; return false; } } else { - *is_dead = (sym->refcount() == 0); return false; } } + bool is_dead(Symbol* value) { + return value->refcount() == 0; + } }; class SymbolTableGet : public StackObj { diff --git a/src/hotspot/share/gc/g1/g1CardSet.cpp b/src/hotspot/share/gc/g1/g1CardSet.cpp index 4e3f08ddc9d..f39e2066739 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.cpp +++ b/src/hotspot/share/gc/g1/g1CardSet.cpp @@ -258,10 +258,13 @@ class G1CardSetHashTable : public CHeapObj { uintx get_hash() const { return G1CardSetHashTable::get_hash(_region_idx); } - bool equals(G1CardSetHashTableValue* value, bool* is_dead) { - *is_dead = false; + bool equals(G1CardSetHashTableValue* value) { return value->_region_idx == _region_idx; } + + bool is_dead(G1CardSetHashTableValue*) { + return false; + } }; class G1CardSetHashTableFound : public StackObj { diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp index fbcbd2b1590..c10fe1f6601 100644 --- a/src/hotspot/share/prims/resolvedMethodTable.cpp +++ b/src/hotspot/share/prims/resolvedMethodTable.cpp @@ -126,11 +126,9 @@ class ResolvedMethodTableLookup : StackObj { uintx get_hash() const { return _hash; } - bool equals(WeakHandle* value, bool* is_dead) { + bool equals(WeakHandle* value) { oop val_oop = value->peek(); if (val_oop == nullptr) { - // dead oop, mark this hash dead for cleaning - *is_dead = true; return false; } bool equals = _method == java_lang_invoke_ResolvedMethodName::vmtarget(val_oop); @@ -141,6 +139,10 @@ class ResolvedMethodTableLookup : StackObj { _found = Handle(_thread, value->resolve()); return true; } + bool is_dead(WeakHandle* value) { + oop val_oop = value->peek(); + return val_oop == nullptr; + } }; diff --git a/src/hotspot/share/services/finalizerService.cpp b/src/hotspot/share/services/finalizerService.cpp index 202a1af0801..ecd9168cd65 100644 --- a/src/hotspot/share/services/finalizerService.cpp +++ b/src/hotspot/share/services/finalizerService.cpp @@ -137,11 +137,14 @@ class FinalizerEntryLookup : StackObj { public: FinalizerEntryLookup(const InstanceKlass* ik) : _ik(ik) {} uintx get_hash() const { return hash_function(_ik); } - bool equals(FinalizerEntry** value, bool* is_dead) { + bool equals(FinalizerEntry** value) { assert(value != nullptr, "invariant"); assert(*value != nullptr, "invariant"); return (*value)->klass() == _ik; } + bool is_dead(FinalizerEntry** value) { + return false; + } }; class FinalizerTableConfig : public AllStatic { diff --git a/src/hotspot/share/services/threadIdTable.cpp b/src/hotspot/share/services/threadIdTable.cpp index ba0e6bdd4fd..168b2e085ad 100644 --- a/src/hotspot/share/services/threadIdTable.cpp +++ b/src/hotspot/share/services/threadIdTable.cpp @@ -187,13 +187,16 @@ class ThreadIdTableLookup : public StackObj { uintx get_hash() const { return _hash; } - bool equals(ThreadIdTableEntry** value, bool* is_dead) { + bool equals(ThreadIdTableEntry** value) { bool equals = primitive_equals(_tid, (*value)->tid()); if (!equals) { return false; } return true; } + bool is_dead(ThreadIdTableEntry** value) { + return false; + } }; class ThreadGet : public StackObj { diff --git a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp index 0d62a9f162e..b222d379b72 100644 --- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp +++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp @@ -455,9 +455,8 @@ inline bool ConcurrentHashTable:: assert(bucket->is_locked(), "Must be locked."); Node* const volatile * rem_n_prev = bucket->first_ptr(); Node* rem_n = bucket->first(); - bool have_dead = false; while (rem_n != nullptr) { - if (lookup_f.equals(rem_n->value(), &have_dead)) { + if (lookup_f.equals(rem_n->value())) { bucket->release_assign_node_ptr(rem_n_prev, rem_n->next()); break; } else { @@ -546,9 +545,7 @@ inline void ConcurrentHashTable:: Node* const volatile * rem_n_prev = bucket->first_ptr(); Node* rem_n = bucket->first(); while (rem_n != nullptr) { - bool is_dead = false; - lookup_f.equals(rem_n->value(), &is_dead); - if (is_dead) { + if (lookup_f.is_dead(rem_n->value())) { ndel[dels++] = rem_n; Node* next_node = rem_n->next(); bucket->release_assign_node_ptr(rem_n_prev, next_node); @@ -626,12 +623,11 @@ ConcurrentHashTable:: size_t loop_count = 0; Node* node = bucket->first(); while (node != nullptr) { - bool is_dead = false; ++loop_count; - if (lookup_f.equals(node->value(), &is_dead)) { + if (lookup_f.equals(node->value())) { break; } - if (is_dead && !(*have_dead)) { + if (!(*have_dead) && lookup_f.is_dead(node->value())) { *have_dead = true; } node = node->next(); diff --git a/test/hotspot/gtest/classfile/test_symbolTable.cpp b/test/hotspot/gtest/classfile/test_symbolTable.cpp index 77d076ec213..4f4cbfe3e89 100644 --- a/test/hotspot/gtest/classfile/test_symbolTable.cpp +++ b/test/hotspot/gtest/classfile/test_symbolTable.cpp @@ -125,3 +125,17 @@ TEST_VM_FATAL_ERROR_MSG(SymbolTable, test_symbol_underflow, ".*refcount has gone my_symbol->decrement_refcount(); my_symbol->increment_refcount(); // Should crash even in PRODUCT mode } + +TEST_VM(SymbolTable, test_cleanup_leak) { + // Check that dead entry cleanup doesn't increment refcount of live entry in same bucket. + + // Create symbol and release ref, marking it available for cleanup. + Symbol* entry1 = SymbolTable::new_symbol("hash_collision_123"); + entry1->decrement_refcount(); + + // Create a new symbol in the same bucket, which will notice the dead entry and trigger cleanup. + // Note: relies on SymbolTable's use of String::hashCode which collides for these two values. + Symbol* entry2 = SymbolTable::new_symbol("hash_collision_397476851"); + + ASSERT_EQ(entry2->refcount(), 1) << "Symbol refcount just created is 1"; +} diff --git a/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp b/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp index 2094565dea3..ca41fc6b0f1 100644 --- a/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp +++ b/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp @@ -107,9 +107,12 @@ struct SimpleTestLookup { uintx get_hash() { return Pointer::get_hash(_val, NULL); } - bool equals(const uintptr_t* value, bool* is_dead) { + bool equals(const uintptr_t* value) { return _val == *value; } + bool is_dead(const uintptr_t* value) { + return false; + } }; struct ValueGet { @@ -561,9 +564,12 @@ struct TestLookup { uintx get_hash() { return TestInterface::get_hash(_val, NULL); } - bool equals(const uintptr_t* value, bool* is_dead) { + bool equals(const uintptr_t* value) { return _val == *value; } + bool is_dead(const uintptr_t* value) { + return false; + } }; static uintptr_t cht_get_copy(TestTable* cht, Thread* thr, TestLookup tl) { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicSharedSymbols.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicSharedSymbols.java index 806313e270e..24305c5a166 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicSharedSymbols.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicSharedSymbols.java @@ -90,7 +90,7 @@ private static void doTest(String topArchiveName) throws Exception { ProcessBuilder pb = new ProcessBuilder(); pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), Long.toString(pid), "VM.symboltable", "-verbose"}); OutputAnalyzer output = CDSTestUtils.executeAndLog(pb, "jcmd-symboltable"); - output.shouldContain("17 3: jdk/test/lib/apps\n"); + output.shouldContain("17 2: jdk/test/lib/apps\n"); output.shouldContain("Dynamic shared symbols:\n"); output.shouldContain("5 65535: Hello\n"); From e56d3bc2dab3d32453b6eda66e8434953c436084 Mon Sep 17 00:00:00 2001 From: Weibing Xiao Date: Mon, 14 Aug 2023 17:38:53 +0000 Subject: [PATCH 042/162] 8313657: com.sun.jndi.ldap.Connection.cleanup does not close connections on SocketTimeoutErrors Reviewed-by: vtewari, msheppar, aefimov --- .../classes/com/sun/jndi/ldap/Connection.java | 53 +++++- .../com/sun/jndi/ldap/SocketCloseTest.java | 168 ++++++++++++++++++ 2 files changed, 212 insertions(+), 9 deletions(-) create mode 100644 test/jdk/com/sun/jndi/ldap/SocketCloseTest.java diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java index 80d788d937a..464ff34d06c 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -643,14 +643,12 @@ void cleanup(Control[] reqCtls, boolean notifyParent) { ldapUnbind(reqCtls); } } finally { - try { - outStream.flush(); - sock.close(); - unpauseReader(); - } catch (IOException ie) { - if (debug) - System.err.println("Connection: problem closing socket: " + ie); - } + + flushAndCloseOutputStream(); + // 8313657 socket is not closed until GC is run + closeOpenedSocket(); + tryUnpauseReader(); + if (!notifyParent) { LdapRequest ldr = pendingRequests; while (ldr != null) { @@ -684,6 +682,43 @@ void cleanup(Control[] reqCtls, boolean notifyParent) { } } + // flush and close output stream + private void flushAndCloseOutputStream() { + try { + outStream.flush(); + } catch (IOException ioEx) { + if (debug) + System.err.println("Connection.flushOutputStream: OutputStream flush problem " + ioEx); + } + try { + outStream.close(); + } catch (IOException ioEx) { + if (debug) + System.err.println("Connection.closeOutputStream: OutputStream close problem " + ioEx); + } + } + + // close socket + private void closeOpenedSocket() { + try { + sock.close(); + } catch (IOException ioEx) { + if (debug) { + System.err.println("Connection.closeConnectionSocket: Socket close problem: " + ioEx); + System.err.println("Socket isClosed: " + sock.isClosed()); + } + } + } + + // unpause reader + private void tryUnpauseReader() { + try { + unpauseReader(); + } catch (IOException ioEx) { + if (debug) + System.err.println("Connection.tryUnpauseReader: unpauseReader problem " + ioEx); + } + } // Assume everything is "quiet" // "synchronize" might lead to deadlock so don't synchronize method diff --git a/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java b/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java new file mode 100644 index 00000000000..a33beb6cacc --- /dev/null +++ b/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.naming.Context; +import javax.naming.directory.DirContext; +import javax.naming.directory.InitialDirContext; +import javax.net.SocketFactory; +import java.net.InetAddress; +import java.net.Socket; +import java.net.SocketAddress; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Hashtable; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/* + * @test + * @bug 8313657 + * @summary make sure socket is closed when the error happens for OutputStream flushing + * The value of provider url can be random, not necessary to be the one in the code + * @library /test/lib + * @run main/othervm SocketCloseTest + */ + +public class SocketCloseTest { + public static String SOCKET_CLOSED_MSG = "The socket has been closed."; + public static String SOCKET_NOT_CLOSED_MSG = "The socket was not closed."; + public static String BAD_FLUSH = "Bad flush!"; + private static final byte[] BIND_RESPONSE = new byte[]{ + 48, 12, 2, 1, 1, 97, 7, 10, 1, 0, 4, 0, 4, 0 + }; + + public static void main(String[] args) throws Exception { + SocketCloseTest scTest = new SocketCloseTest(); + scTest.runCloseSocketScenario(); + } + + public void runCloseSocketScenario() throws Exception { + Hashtable props = new Hashtable<>(); + + props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); + props.put(Context.PROVIDER_URL, "ldap://localhost:1389/o=example"); + props.put("java.naming.ldap.factory.socket", CustomSocketFactory.class.getName()); + try { + final DirContext ctx = new InitialDirContext(props); + } catch (Exception e) { + if (CustomSocketFactory.customSocket.closeMethodCalledCount() > 0) { + System.out.println(SOCKET_CLOSED_MSG); + } else { + System.out.println(SOCKET_NOT_CLOSED_MSG); + throw e; + } + } + } + + public static class CustomSocketFactory extends SocketFactory { + public static CustomSocket customSocket = new CustomSocket(); + + public static CustomSocketFactory getDefault() { + return new CustomSocketFactory(); + } + + @Override + public Socket createSocket() { + return customSocket; + } + + @Override + public Socket createSocket(String s, int timeout) { + return customSocket; + } + + @Override + public Socket createSocket(String host, int port, InetAddress localHost, + int localPort) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress host, int port) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress address, int port, + InetAddress localAddress, int localPort) { + return customSocket; + } + } + + private static class LdapInputStream extends InputStream { + private ByteArrayInputStream bos; + + public LdapInputStream() { + } + + @Override + public int read() throws IOException { + bos = new ByteArrayInputStream(BIND_RESPONSE); + return bos.read(); + } + } + + private static class LdapOutputStream extends OutputStream { + + @Override + public void write(int b) throws IOException { + System.out.println("output stream writing"); + } + + @Override + public void flush() throws IOException { + System.out.println(BAD_FLUSH); + throw new IOException(BAD_FLUSH); + } + } + + private static class CustomSocket extends Socket { + private int closeMethodCalled = 0; + private LdapOutputStream output = new LdapOutputStream(); + private LdapInputStream input = new LdapInputStream(); + + public void connect(SocketAddress address, int timeout) { + } + + public InputStream getInputStream() { + return input; + } + + public OutputStream getOutputStream() { + return output; + } + + public int closeMethodCalledCount() { + return closeMethodCalled; + } + + @Override + public void close() throws IOException { + closeMethodCalled++; + super.close(); + } + } +} From c132176b932dd136d5c4314e08ac97d0fee7ba4d Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Mon, 14 Aug 2023 17:48:50 +0000 Subject: [PATCH 043/162] 8114830: (fs) Files.copy fails due to interference from something else changing the file system Reviewed-by: alanb, vtewari --- .../classes/sun/nio/fs/UnixFileSystem.java | 9 ++ .../java/nio/file/Files/CopyInterference.java | 150 ++++++++++++++++++ 2 files changed, 159 insertions(+) create mode 100644 test/jdk/java/nio/file/Files/CopyInterference.java diff --git a/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java b/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java index 7cab6d31690..9a93a69d789 100644 --- a/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java +++ b/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java @@ -32,6 +32,7 @@ import java.nio.file.FileAlreadyExistsException; import java.nio.file.FileStore; import java.nio.file.FileSystem; +import java.nio.file.FileSystemException; import java.nio.file.LinkOption; import java.nio.file.LinkPermission; import java.nio.file.Path; @@ -519,6 +520,8 @@ private void copyDirectory(UnixPath source, try { mkdir(target, attrs.mode()); } catch (UnixException x) { + if (x.errno() == EEXIST && flags.replaceExisting) + throw new FileSystemException(target.toString()); x.rethrowAsIOException(target); } @@ -665,6 +668,8 @@ void copyFile(UnixPath source, O_EXCL), attrs.mode()); } catch (UnixException x) { + if (x.errno() == EEXIST && flags.replaceExisting) + throw new FileSystemException(target.toString()); x.rethrowAsIOException(target); } @@ -783,6 +788,8 @@ private void copyLink(UnixPath source, } } } catch (UnixException x) { + if (x.errno() == EEXIST && flags.replaceExisting) + throw new FileSystemException(target.toString()); x.rethrowAsIOException(target); } } @@ -797,6 +804,8 @@ private void copySpecial(UnixPath source, try { mknod(target, attrs.mode(), attrs.rdev()); } catch (UnixException x) { + if (x.errno() == EEXIST && flags.replaceExisting) + throw new FileSystemException(target.toString()); x.rethrowAsIOException(target); } boolean done = false; diff --git a/test/jdk/java/nio/file/Files/CopyInterference.java b/test/jdk/java/nio/file/Files/CopyInterference.java new file mode 100644 index 00000000000..a9319900dc5 --- /dev/null +++ b/test/jdk/java/nio/file/Files/CopyInterference.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8114830 + * @summary Verify FileAlreadyExistsException is not thrown for REPLACE_EXISTING + * @run junit CopyInterference + */ +import java.io.InputStream; +import java.io.IOException; +import java.nio.file.CopyOption; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.Files; +import java.nio.file.FileSystemException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.stream.Stream; + +import static java.nio.file.StandardCopyOption.*; +import static java.nio.file.LinkOption.*; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +public class CopyInterference { + + private static final int N_THREADS = 2; + + private static final AtomicBoolean running = new AtomicBoolean(true); + + private static class CopyTask implements Runnable { + final Path source; + final Path target; + final CopyOption[] options; + + CopyTask(Path source, Path target, CopyOption[] options) { + this.source = source; + this.target = target; + this.options = options; + } + + @Override + public void run() { + try { + while (running.get()) { + Files.copy(source, target, options); + } + } catch (FileAlreadyExistsException e) { + throw new RuntimeException("Unexpected exception", e); + } catch (FileSystemException e) { + System.out.printf("Expected FileSystemException: \"%s\"%n", + e.getMessage()); + } catch (IOException e) { + throw new RuntimeException("Unexpected exception", e); + } finally { + running.set(false); + } + } + } + + private static Stream pathAndOptionsProvider() + throws IOException { + Path parent = Path.of(System.getProperty("test.dir", ".")); + Path dir = Files.createTempDirectory(parent, "foobargus"); + + List list = new ArrayList(); + + // regular file + Path sourceFile = Files.createTempFile(dir, "foo", "baz"); + Class c = CopyInterference.class; + String name = "CopyInterference.class"; + + try (InputStream in = c.getResourceAsStream(name)) { + Files.copy(in, sourceFile, REPLACE_EXISTING); + } + + Arguments args = Arguments.of(sourceFile, dir.resolve("targetFile"), + new CopyOption[] {REPLACE_EXISTING}); + list.add(args); + + // directory + Path sourceDirectory = Files.createTempDirectory(dir, "fubar"); + args = Arguments.of(sourceDirectory, dir.resolve("targetDir"), + new CopyOption[] {REPLACE_EXISTING}); + list.add(args); + + // symblic link, followed + Path link = dir.resolve("link"); + Files.createSymbolicLink(link, sourceFile); + args = Arguments.of(link, dir.resolve("linkFollowed"), + new CopyOption[] {REPLACE_EXISTING}); + list.add(args); + + // symblic link, not followed + args = Arguments.of(link, dir.resolve("linkNotFollowed"), + new CopyOption[] {REPLACE_EXISTING, NOFOLLOW_LINKS}); + list.add(args); + + return list.stream(); + } + + @ParameterizedTest + @MethodSource("pathAndOptionsProvider") + void copy(Path source, Path target, CopyOption[] options) + throws InterruptedException, IOException { + + Future[] results = new Future[N_THREADS]; + try (ExecutorService es = Executors.newFixedThreadPool(N_THREADS)) { + CopyTask copyTask = new CopyTask(source, target, options); + for (int i = 0; i < N_THREADS; i++) + results[i] = es.submit(copyTask); + } + + for (Future res : results) { + try { + res.get(); + } catch (ExecutionException e) { + throw new RuntimeException(res.exceptionNow()); + } + } + } +} From 49b29845f7c516c379dde7aae8b3073808f2118a Mon Sep 17 00:00:00 2001 From: Kimura Yukihiro Date: Mon, 14 Aug 2023 18:26:55 +0000 Subject: [PATCH 044/162] 8313854: Some tests in serviceability area fail on localized Windows platform Reviewed-by: amenkov, cjplummer --- .../sun/management/jmxremote/startstop/JMXStartStopTest.java | 4 +++- test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java b/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java index 283cccd8397..2a611803a18 100644 --- a/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java +++ b/test/jdk/sun/management/jmxremote/startstop/JMXStartStopTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -393,6 +393,8 @@ private static TestAppRun doTest(String name, String ... args) List pbArgs = new ArrayList<>(Arrays.asList( "-cp", System.getProperty("test.class.path"), + "-Duser.language=en", + "-Duser.country=US", "-XX:+UsePerfData" )); pbArgs.addAll(Arrays.asList(args)); diff --git a/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java b/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java index a6641319096..7ca36d40a6f 100644 --- a/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java +++ b/test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java @@ -158,6 +158,9 @@ public static void launchJshell() throws IOException { launcher.addVMArgs(Utils.getFilteredTestJavaOpts("-XX:\\+UseSerialGC")); } ProcessBuilder pb = new ProcessBuilder(launcher.getCommand()); + // Needed so we can properly parse the "Welcome to JShell" output. + pb.command().add("-J-Duser.language=en"); + pb.command().add("-J-Duser.country=US"); jShellProcess = ProcessTools.startProcess("JShell", pb, s -> { // warm-up predicate return s.contains("Welcome to JShell"); From 595fdd36c5f735b53ed2950c539be46382f9bcdd Mon Sep 17 00:00:00 2001 From: Ben Perez Date: Mon, 14 Aug 2023 18:39:18 +0000 Subject: [PATCH 045/162] 8314059: Remove PKCS7.verify() Reviewed-by: mullan --- .../share/classes/sun/security/pkcs/PKCS7.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/java.base/share/classes/sun/security/pkcs/PKCS7.java b/src/java.base/share/classes/sun/security/pkcs/PKCS7.java index cb278402094..10bf8fd7c34 100644 --- a/src/java.base/share/classes/sun/security/pkcs/PKCS7.java +++ b/src/java.base/share/classes/sun/security/pkcs/PKCS7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -557,17 +557,6 @@ public SignerInfo[] verify(byte[] bytes) return null; } - /** - * Returns all signerInfos which self-verify. - * - * @exception NoSuchAlgorithmException on unrecognized algorithms. - * @exception SignatureException on signature handling errors. - */ - public SignerInfo[] verify() - throws NoSuchAlgorithmException, SignatureException { - return verify(null); - } - /** * Returns the version number of this PKCS7 block. * @return the version or null if version is not specified From f142470deaebbf9cff7f6f28842972393506b7c4 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Mon, 14 Aug 2023 21:18:57 +0000 Subject: [PATCH 046/162] 8311981: Test gc/stringdedup/TestStringDeduplicationAgeThreshold.java#ZGenerational timed out Reviewed-by: stefank, pchilanomate, dcubed, rehn --- src/hotspot/share/runtime/handshake.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/runtime/handshake.cpp b/src/hotspot/share/runtime/handshake.cpp index b4534837cad..e3ecc2be6fd 100644 --- a/src/hotspot/share/runtime/handshake.cpp +++ b/src/hotspot/share/runtime/handshake.cpp @@ -497,8 +497,17 @@ HandshakeOperation* HandshakeState::get_op_for_self(bool allow_suspend, bool che } bool HandshakeState::has_operation(bool allow_suspend, bool check_async_exception) { - MutexLocker ml(&_lock, Mutex::_no_safepoint_check_flag); - return get_op_for_self(allow_suspend, check_async_exception) != nullptr; + // We must not block here as that could lead to deadlocks if we already hold an + // "external" mutex. If the try_lock fails then we assume that there is an operation + // and force the caller to check more carefully in a safer context. If we can't get + // the lock it means another thread is trying to handshake with us, so it can't + // happen during thread termination and destruction. + bool ret = true; + if (_lock.try_lock()) { + ret = get_op_for_self(allow_suspend, check_async_exception) != nullptr; + _lock.unlock(); + } + return ret; } bool HandshakeState::has_async_exception_operation() { From 1f1c5c6f8d0bc2492e2ab3280e838fe9981c4e38 Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Mon, 14 Aug 2023 22:23:11 +0000 Subject: [PATCH 047/162] 8314241: Add test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java to ProblemList Reviewed-by: dcubed, dholmes --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 24655fcb8c0..2de1708174e 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -607,6 +607,7 @@ sun/security/pkcs11/rsa/TestSignatures.java 8295343 linux-al sun/security/pkcs11/rsa/TestKeyPairGenerator.java 8295343 linux-all sun/security/pkcs11/rsa/TestKeyFactory.java 8295343 linux-all sun/security/pkcs11/KeyStore/Basic.java 8295343 linux-all +sun/security/pkcs/pkcs7/SignerOrder.java 8314240 generic-all ############################################################################ From 0074b48ad77d68ece8633a165aaba7f42bb52c5d Mon Sep 17 00:00:00 2001 From: Ben Taylor Date: Mon, 14 Aug 2023 22:50:37 +0000 Subject: [PATCH 048/162] 8312597: Convert TraceTypeProfile to UL Reviewed-by: shade, phh --- src/hotspot/share/opto/doCall.cpp | 27 ++++++++++---- .../jtreg/compiler/arguments/TestLogJIT.java | 36 ++++++++++++++++++ .../arguments/TestTraceTypeProfile.java | 37 +++++++++++++++++++ 3 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/arguments/TestLogJIT.java create mode 100644 test/hotspot/jtreg/compiler/arguments/TestTraceTypeProfile.java diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp index 4f3184cb48b..7e9e08a7e1b 100644 --- a/src/hotspot/share/opto/doCall.cpp +++ b/src/hotspot/share/opto/doCall.cpp @@ -30,6 +30,10 @@ #include "compiler/compileBroker.hpp" #include "compiler/compileLog.hpp" #include "interpreter/linkResolver.hpp" +#include "logging/log.hpp" +#include "logging/logLevel.hpp" +#include "logging/logMessage.hpp" +#include "logging/logStream.hpp" #include "opto/addnode.hpp" #include "opto/callGenerator.hpp" #include "opto/castnode.hpp" @@ -46,7 +50,15 @@ #include "jfr/jfr.hpp" #endif -void trace_type_profile(Compile* C, ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) { +void print_trace_type_profile(outputStream* out, int depth, ciKlass* prof_klass, int site_count, int receiver_count) { + CompileTask::print_inline_indent(depth, out); + out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count); + prof_klass->name()->print_symbol_on(out); + out->cr(); +} + +void trace_type_profile(Compile* C, ciMethod* method, int depth, int bci, ciMethod* prof_method, + ciKlass* prof_klass, int site_count, int receiver_count) { if (TraceTypeProfile || C->print_inlining()) { outputStream* out = tty; if (!C->print_inlining()) { @@ -58,12 +70,13 @@ void trace_type_profile(Compile* C, ciMethod *method, int depth, int bci, ciMeth } else { out = C->print_inlining_stream(); } - CompileTask::print_inline_indent(depth, out); - out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count); - stringStream ss; - prof_klass->name()->print_symbol_on(&ss); - out->print("%s", ss.freeze()); - out->cr(); + print_trace_type_profile(out, depth, prof_klass, site_count, receiver_count); + } + + LogTarget(Debug, jit, inlining) lt; + if (lt.is_enabled()) { + LogStream ls(lt); + print_trace_type_profile(&ls, depth, prof_klass, site_count, receiver_count); } } diff --git a/test/hotspot/jtreg/compiler/arguments/TestLogJIT.java b/test/hotspot/jtreg/compiler/arguments/TestLogJIT.java new file mode 100644 index 00000000000..5974419a4c2 --- /dev/null +++ b/test/hotspot/jtreg/compiler/arguments/TestLogJIT.java @@ -0,0 +1,36 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Amazon designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* + * @test + * @summary Test running with log:jit*=debug enabled. + * @run main/othervm -Xlog:jit*=debug compiler.arguments.TestTraceTypeProfile + */ + +package compiler.arguments; + +public class TestLogJIT { + + static public void main(String[] args) { + System.out.println("Passed"); + } +} + diff --git a/test/hotspot/jtreg/compiler/arguments/TestTraceTypeProfile.java b/test/hotspot/jtreg/compiler/arguments/TestTraceTypeProfile.java new file mode 100644 index 00000000000..f2797b329f1 --- /dev/null +++ b/test/hotspot/jtreg/compiler/arguments/TestTraceTypeProfile.java @@ -0,0 +1,37 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Amazon designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* + * @test + * @summary Test running TraceTypeProfile enabled. + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:+TraceTypeProfile compiler.arguments.TestTraceTypeProfile + */ + +package compiler.arguments; + +public class TestTraceTypeProfile { + + static public void main(String[] args) { + System.out.println("Passed"); + } +} + From 583cb754f38f5d32144e302ce5e82a3b36a2cb78 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Mon, 14 Aug 2023 23:12:42 +0000 Subject: [PATCH 049/162] 8313406: nep_invoker_blob can be simplified more Reviewed-by: jvernee, vlivanov --- src/hotspot/cpu/x86/downcallLinker_x86_64.cpp | 4 +- .../foreign/abi/x64/sysv/CallArranger.java | 6 +- .../callarranger/TestSysVCallArranger.java | 57 ++++++++----------- 3 files changed, 30 insertions(+), 37 deletions(-) diff --git a/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp b/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp index 68fe831f48c..2da44a4e308 100644 --- a/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp +++ b/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp @@ -201,7 +201,9 @@ void DowncallStubGenerator::generate() { __ enter(); // return address and rbp are already in place - __ subptr(rsp, allocated_frame_size); // prolog + if (allocated_frame_size > 0) { + __ subptr(rsp, allocated_frame_size); // prolog + } _frame_complete = __ pc() - start; diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java b/src/java.base/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java index 0a2669c3726..59224022e74 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java @@ -116,7 +116,7 @@ public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, bool csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout)); } - if (!forUpcall) { + if (!forUpcall && options.isVariadicFunction()) { //add extra binding for number of used vector registers (used for variadic calls) csb.addArgumentBindings(long.class, C_LONG, List.of(vmStore(rax, long.class))); @@ -129,7 +129,9 @@ public static MethodHandle arrangeDowncall(MethodType mt, FunctionDescriptor cDe Bindings bindings = getBindings(mt, cDesc, false, options); MethodHandle handle = new DowncallLinker(CSysV, bindings.callingSequence).getBoundMethodHandle(); - handle = MethodHandles.insertArguments(handle, handle.type().parameterCount() - 1, bindings.nVectorArgs); + if (options.isVariadicFunction()) { + handle = MethodHandles.insertArguments(handle, handle.type().parameterCount() - 1, bindings.nVectorArgs); + } if (bindings.isInMemoryReturn) { handle = SharedUtils.adaptDowncallForIMR(handle, cDesc, bindings.callingSequence); diff --git a/test/jdk/java/foreign/callarranger/TestSysVCallArranger.java b/test/jdk/java/foreign/callarranger/TestSysVCallArranger.java index 1405feb04a4..ceb23f7ea06 100644 --- a/test/jdk/java/foreign/callarranger/TestSysVCallArranger.java +++ b/test/jdk/java/foreign/callarranger/TestSysVCallArranger.java @@ -71,12 +71,11 @@ public void testEmpty() { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, - { vmStore(rax, long.class) } }); checkReturnBindings(callingSequence, new Binding[]{}); @@ -99,14 +98,13 @@ public void testNestedStructs() { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, { dup(), bufferLoad(0, long.class), vmStore(rdi, long.class), bufferLoad(8, int.class), vmStore(rsi, int.class)}, - { vmStore(rax, long.class) }, }); checkReturnBindings(callingSequence, new Binding[]{}); @@ -130,14 +128,13 @@ public void testNestedUnion() { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, { dup(), bufferLoad(0, long.class), vmStore(rdi, long.class), bufferLoad(8, long.class), vmStore(rsi, long.class)}, - { vmStore(rax, long.class) }, }); checkReturnBindings(callingSequence, new Binding[]{}); @@ -155,8 +152,8 @@ public void testIntegerRegs() { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, @@ -166,7 +163,6 @@ public void testIntegerRegs() { { vmStore(rcx, int.class) }, { vmStore(r8, int.class) }, { vmStore(r9, int.class) }, - { vmStore(rax, long.class) }, }); checkReturnBindings(callingSequence, new Binding[]{}); @@ -186,8 +182,8 @@ public void testDoubleRegs() { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, @@ -199,7 +195,6 @@ public void testDoubleRegs() { { vmStore(xmm5, double.class) }, { vmStore(xmm6, double.class) }, { vmStore(xmm7, double.class) }, - { vmStore(rax, long.class) }, }); checkReturnBindings(callingSequence, new Binding[]{}); @@ -221,8 +216,8 @@ public void testMixed() { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, @@ -244,7 +239,6 @@ public void testMixed() { { vmStore(xmm7, float.class) }, { vmStore(stackStorage(STACK_SLOT_SIZE, 16), float.class) }, { vmStore(stackStorage(STACK_SLOT_SIZE, 24), float.class) }, - { vmStore(rax, long.class) }, }); checkReturnBindings(callingSequence, new Binding[]{}); @@ -278,8 +272,8 @@ public void testAbiExample() { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, @@ -297,7 +291,6 @@ public void testAbiExample() { { vmStore(r9, int.class) }, { vmStore(stackStorage(STACK_SLOT_SIZE, 0), int.class) }, { vmStore(stackStorage(STACK_SLOT_SIZE, 8), int.class) }, - { vmStore(rax, long.class) }, }); checkReturnBindings(callingSequence, new Binding[]{}); @@ -321,13 +314,12 @@ public void testMemoryAddress() { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, { unboxAddress(), vmStore(rdi, long.class) }, - { vmStore(rax, long.class) }, }); checkReturnBindings(callingSequence, new Binding[]{}); @@ -343,13 +335,12 @@ public void testStruct(MemoryLayout struct, Binding[] expectedBindings) { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, expectedBindings, - { vmStore(rax, long.class) }, }); checkReturnBindings(callingSequence, new Binding[]{}); @@ -402,13 +393,12 @@ public void testReturnRegisterStruct() { assertFalse(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), mt.appendParameterTypes(long.class).insertParameterTypes(0, MemorySegment.class, MemorySegment.class)); - assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG).insertArgumentLayouts(0, ADDRESS, ADDRESS)); + assertEquals(callingSequence.callerMethodType(), mt.insertParameterTypes(0, MemorySegment.class, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), fd.insertArgumentLayouts(0, ADDRESS, ADDRESS)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(RETURN_BUFFER_STORAGE, long.class) }, { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, - { vmStore(rax, long.class) } }); checkReturnBindings(callingSequence, new Binding[] { @@ -434,13 +424,12 @@ public void testIMR() { assertTrue(bindings.isInMemoryReturn()); CallingSequence callingSequence = bindings.callingSequence(); - assertEquals(callingSequence.callerMethodType(), MethodType.methodType(void.class, MemorySegment.class, MemorySegment.class, long.class)); - assertEquals(callingSequence.functionDesc(), FunctionDescriptor.ofVoid(ADDRESS, C_POINTER, C_LONG)); + assertEquals(callingSequence.callerMethodType(), MethodType.methodType(void.class, MemorySegment.class, MemorySegment.class)); + assertEquals(callingSequence.functionDesc(), FunctionDescriptor.ofVoid(ADDRESS, C_POINTER)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(TARGET_ADDRESS_STORAGE, long.class) }, - { unboxAddress(), vmStore(rdi, long.class) }, - { vmStore(rax, long.class) } + { unboxAddress(), vmStore(rdi, long.class) } }); checkReturnBindings(callingSequence, new Binding[] {}); From 37c6b23f5b82311c82f5fe981f104824f87e3e54 Mon Sep 17 00:00:00 2001 From: Fei Gao Date: Tue, 15 Aug 2023 01:04:22 +0000 Subject: [PATCH 050/162] 8308340: C2: Idealize Fma nodes Reviewed-by: kvn, epeter --- src/hotspot/cpu/aarch64/aarch64.ad | 49 +++-- src/hotspot/cpu/aarch64/aarch64_vector.ad | 81 +++----- src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 | 81 +++----- src/hotspot/cpu/ppc/ppc.ad | 49 +++-- src/hotspot/cpu/riscv/riscv.ad | 37 ++-- src/hotspot/cpu/riscv/riscv_v.ad | 56 +++--- src/hotspot/cpu/s390/s390.ad | 15 ++ src/hotspot/cpu/x86/x86.ad | 8 +- src/hotspot/share/opto/c2compiler.cpp | 4 +- src/hotspot/share/opto/mulnode.cpp | 14 ++ src/hotspot/share/opto/mulnode.hpp | 22 ++- src/hotspot/share/opto/node.hpp | 8 +- src/hotspot/share/opto/subnode.hpp | 4 +- src/hotspot/share/opto/vectornode.cpp | 15 ++ src/hotspot/share/opto/vectornode.hpp | 26 ++- .../jtreg/compiler/c2/irTests/TestIRFma.java | 185 ++++++++++++++++++ .../compiler/lib/ir_framework/IRNode.java | 35 ++++ .../VectorFusedMultiplyAddSubTest.java | 82 +++++++- .../runner/BasicDoubleOpTest.java | 10 +- .../runner/BasicFloatOpTest.java | 10 +- 20 files changed, 571 insertions(+), 220 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/irTests/TestIRFma.java diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 6990e7c60b9..7ce4ed9584d 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -2289,7 +2289,6 @@ bool Matcher::match_rule_supported(int opcode) { if (!has_match_rule(opcode)) return false; - bool ret_value = true; switch (opcode) { case Op_OnSpinWait: return VM_Version::supports_on_spin_wait(); @@ -2297,18 +2296,26 @@ bool Matcher::match_rule_supported(int opcode) { case Op_CacheWBPreSync: case Op_CacheWBPostSync: if (!VM_Version::supports_data_cache_line_flush()) { - ret_value = false; + return false; } break; case Op_ExpandBits: case Op_CompressBits: if (!VM_Version::supports_svebitperm()) { - ret_value = false; + return false; + } + break; + case Op_FmaF: + case Op_FmaD: + case Op_FmaVF: + case Op_FmaVD: + if (!UseFMA) { + return false; } break; } - return ret_value; // Per default match rules are supported. + return true; // Per default match rules are supported. } const RegMask* Matcher::predicate_reg_mask(void) { @@ -14305,12 +14312,12 @@ instruct mulD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ // src1 * src2 + src3 instruct maddF_reg_reg(vRegF dst, vRegF src1, vRegF src2, vRegF src3) %{ - predicate(UseFMA); match(Set dst (FmaF src3 (Binary src1 src2))); format %{ "fmadds $dst, $src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmadds(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -14322,12 +14329,12 @@ instruct maddF_reg_reg(vRegF dst, vRegF src1, vRegF src2, vRegF src3) %{ // src1 * src2 + src3 instruct maddD_reg_reg(vRegD dst, vRegD src1, vRegD src2, vRegD src3) %{ - predicate(UseFMA); match(Set dst (FmaD src3 (Binary src1 src2))); format %{ "fmaddd $dst, $src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmaddd(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -14337,15 +14344,15 @@ instruct maddD_reg_reg(vRegD dst, vRegD src1, vRegD src2, vRegD src3) %{ ins_pipe(pipe_class_default); %} -// -src1 * src2 + src3 +// src1 * (-src2) + src3 +// "(-src1) * src2 + src3" has been idealized to "src2 * (-src1) + src3" instruct msubF_reg_reg(vRegF dst, vRegF src1, vRegF src2, vRegF src3) %{ - predicate(UseFMA); - match(Set dst (FmaF src3 (Binary (NegF src1) src2))); match(Set dst (FmaF src3 (Binary src1 (NegF src2)))); format %{ "fmsubs $dst, $src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmsubs(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -14355,15 +14362,15 @@ instruct msubF_reg_reg(vRegF dst, vRegF src1, vRegF src2, vRegF src3) %{ ins_pipe(pipe_class_default); %} -// -src1 * src2 + src3 +// src1 * (-src2) + src3 +// "(-src1) * src2 + src3" has been idealized to "src2 * (-src1) + src3" instruct msubD_reg_reg(vRegD dst, vRegD src1, vRegD src2, vRegD src3) %{ - predicate(UseFMA); - match(Set dst (FmaD src3 (Binary (NegD src1) src2))); match(Set dst (FmaD src3 (Binary src1 (NegD src2)))); format %{ "fmsubd $dst, $src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmsubd(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -14373,15 +14380,15 @@ instruct msubD_reg_reg(vRegD dst, vRegD src1, vRegD src2, vRegD src3) %{ ins_pipe(pipe_class_default); %} -// -src1 * src2 - src3 +// src1 * (-src2) - src3 +// "(-src1) * src2 - src3" has been idealized to "src2 * (-src1) - src3" instruct mnaddF_reg_reg(vRegF dst, vRegF src1, vRegF src2, vRegF src3) %{ - predicate(UseFMA); - match(Set dst (FmaF (NegF src3) (Binary (NegF src1) src2))); match(Set dst (FmaF (NegF src3) (Binary src1 (NegF src2)))); format %{ "fnmadds $dst, $src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmadds(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -14391,15 +14398,15 @@ instruct mnaddF_reg_reg(vRegF dst, vRegF src1, vRegF src2, vRegF src3) %{ ins_pipe(pipe_class_default); %} -// -src1 * src2 - src3 +// src1 * (-src2) - src3 +// "(-src1) * src2 - src3" has been idealized to "src2 * (-src1) - src3" instruct mnaddD_reg_reg(vRegD dst, vRegD src1, vRegD src2, vRegD src3) %{ - predicate(UseFMA); - match(Set dst (FmaD (NegD src3) (Binary (NegD src1) src2))); match(Set dst (FmaD (NegD src3) (Binary src1 (NegD src2)))); format %{ "fnmaddd $dst, $src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmaddd(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -14411,12 +14418,12 @@ instruct mnaddD_reg_reg(vRegD dst, vRegD src1, vRegD src2, vRegD src3) %{ // src1 * src2 - src3 instruct mnsubF_reg_reg(vRegF dst, vRegF src1, vRegF src2, vRegF src3, immF0 zero) %{ - predicate(UseFMA); match(Set dst (FmaF (NegF src3) (Binary src1 src2))); format %{ "fnmsubs $dst, $src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmsubs(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -14428,13 +14435,13 @@ instruct mnsubF_reg_reg(vRegF dst, vRegF src1, vRegF src2, vRegF src3, immF0 zer // src1 * src2 - src3 instruct mnsubD_reg_reg(vRegD dst, vRegD src1, vRegD src2, vRegD src3, immD0 zero) %{ - predicate(UseFMA); match(Set dst (FmaD (NegD src3) (Binary src1 src2))); format %{ "fnmsubd $dst, $src1, $src2, $src3" %} ins_encode %{ - // n.b. insn name should be fnmsubd + assert(UseFMA, "Needs FMA instructions support."); + // n.b. insn name should be fnmsubd __ fnmsub(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), diff --git a/src/hotspot/cpu/aarch64/aarch64_vector.ad b/src/hotspot/cpu/aarch64/aarch64_vector.ad index bd669e99435..a0df8fc3c97 100644 --- a/src/hotspot/cpu/aarch64/aarch64_vector.ad +++ b/src/hotspot/cpu/aarch64/aarch64_vector.ad @@ -2131,14 +2131,14 @@ instruct vmla_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ %} // vector fmla -// dst_src1 = dst_src1 + src2 * src3 +// dst_src1 = src2 * src3 + dst_src1 instruct vfmla(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); match(Set dst_src1 (FmaVF dst_src1 (Binary src2 src3))); match(Set dst_src1 (FmaVD dst_src1 (Binary src2 src3))); format %{ "vfmla $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); uint length_in_bytes = Matcher::vector_length_in_bytes(this); if (VM_Version::use_neon_for_vector(length_in_bytes)) { __ fmla($dst_src1$$FloatRegister, get_arrangement(this), @@ -2157,11 +2157,12 @@ instruct vfmla(vReg dst_src1, vReg src2, vReg src3) %{ // dst_src1 = dst_src1 * src2 + src3 instruct vfmad_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (Binary dst_src1 src2) (Binary src3 pg))); match(Set dst_src1 (FmaVD (Binary dst_src1 src2) (Binary src3 pg))); format %{ "vfmad_masked $dst_src1, $pg, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fmad($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), $pg$$PRegister, $src2$$FloatRegister, $src3$$FloatRegister); @@ -2221,34 +2222,14 @@ instruct vmls_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ // vector fmls -// dst_src1 = dst_src1 + -src2 * src3 -instruct vfmls1(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); - match(Set dst_src1 (FmaVF dst_src1 (Binary (NegVF src2) src3))); - match(Set dst_src1 (FmaVD dst_src1 (Binary (NegVD src2) src3))); - format %{ "vfmls1 $dst_src1, $src2, $src3" %} - ins_encode %{ - uint length_in_bytes = Matcher::vector_length_in_bytes(this); - if (VM_Version::use_neon_for_vector(length_in_bytes)) { - __ fmls($dst_src1$$FloatRegister, get_arrangement(this), - $src2$$FloatRegister, $src3$$FloatRegister); - } else { - assert(UseSVE > 0, "must be sve"); - BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_fmls($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), - ptrue, $src2$$FloatRegister, $src3$$FloatRegister); - } - %} - ins_pipe(pipe_slow); -%} - -// dst_src1 = dst_src1 + src2 * -src3 -instruct vfmls2(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); +// dst_src1 = src2 * (-src3) + dst_src1 +// "(-src2) * src3 + dst_src1" has been idealized to "src3 * (-src2) + dst_src1" +instruct vfmls(vReg dst_src1, vReg src2, vReg src3) %{ match(Set dst_src1 (FmaVF dst_src1 (Binary src2 (NegVF src3)))); match(Set dst_src1 (FmaVD dst_src1 (Binary src2 (NegVD src3)))); - format %{ "vfmls2 $dst_src1, $src2, $src3" %} + format %{ "vfmls $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); uint length_in_bytes = Matcher::vector_length_in_bytes(this); if (VM_Version::use_neon_for_vector(length_in_bytes)) { __ fmls($dst_src1$$FloatRegister, get_arrangement(this), @@ -2265,13 +2246,14 @@ instruct vfmls2(vReg dst_src1, vReg src2, vReg src3) %{ // vector fmsb - predicated -// dst_src1 = dst_src1 * -src2 + src3 +// dst_src1 = dst_src1 * (-src2) + src3 instruct vfmsb_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (Binary dst_src1 (NegVF src2)) (Binary src3 pg))); match(Set dst_src1 (FmaVD (Binary dst_src1 (NegVD src2)) (Binary src3 pg))); format %{ "vfmsb_masked $dst_src1, $pg, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fmsb($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), $pg$$PRegister, $src2$$FloatRegister, $src3$$FloatRegister); @@ -2281,27 +2263,15 @@ instruct vfmsb_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ // vector fnmla (sve) -// dst_src1 = -dst_src1 + -src2 * src3 -instruct vfnmla1(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA && UseSVE > 0); - match(Set dst_src1 (FmaVF (NegVF dst_src1) (Binary (NegVF src2) src3))); - match(Set dst_src1 (FmaVD (NegVD dst_src1) (Binary (NegVD src2) src3))); - format %{ "vfnmla1 $dst_src1, $src2, $src3" %} - ins_encode %{ - BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_fnmla($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), - ptrue, $src2$$FloatRegister, $src3$$FloatRegister); - %} - ins_pipe(pipe_slow); -%} - -// dst_src1 = -dst_src1 + src2 * -src3 -instruct vfnmla2(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA && UseSVE > 0); +// dst_src1 = src2 * (-src3) - dst_src1 +// "(-src2) * src3 - dst_src1" has been idealized to "src3 * (-src2) - dst_src1" +instruct vfnmla(vReg dst_src1, vReg src2, vReg src3) %{ + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (NegVF dst_src1) (Binary src2 (NegVF src3)))); match(Set dst_src1 (FmaVD (NegVD dst_src1) (Binary src2 (NegVD src3)))); - format %{ "vfnmla2 $dst_src1, $src2, $src3" %} + format %{ "vfnmla $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fnmla($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), ptrue, $src2$$FloatRegister, $src3$$FloatRegister); @@ -2311,13 +2281,14 @@ instruct vfnmla2(vReg dst_src1, vReg src2, vReg src3) %{ // vector fnmad - predicated -// dst_src1 = -src3 + dst_src1 * -src2 +// dst_src1 = dst_src1 * (-src2) - src3 instruct vfnmad_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (Binary dst_src1 (NegVF src2)) (Binary (NegVF src3) pg))); match(Set dst_src1 (FmaVD (Binary dst_src1 (NegVD src2)) (Binary (NegVD src3) pg))); format %{ "vfnmad_masked $dst_src1, $pg, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fnmad($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), $pg$$PRegister, $src2$$FloatRegister, $src3$$FloatRegister); @@ -2327,13 +2298,14 @@ instruct vfnmad_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ // vector fnmls (sve) -// dst_src1 = -dst_src1 + src2 * src3 +// dst_src1 = src2 * src3 - dst_src1 instruct vfnmls(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (NegVF dst_src1) (Binary src2 src3))); match(Set dst_src1 (FmaVD (NegVD dst_src1) (Binary src2 src3))); format %{ "vfnmls $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fnmls($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), ptrue, $src2$$FloatRegister, $src3$$FloatRegister); @@ -2343,13 +2315,14 @@ instruct vfnmls(vReg dst_src1, vReg src2, vReg src3) %{ // vector fnmsb - predicated -// dst_src1 = -src3 + dst_src1 * src2 +// dst_src1 = dst_src1 * src2 - src3 instruct vfnmsb_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (Binary dst_src1 src2) (Binary (NegVF src3) pg))); match(Set dst_src1 (FmaVD (Binary dst_src1 src2) (Binary (NegVD src3) pg))); format %{ "vfnmsb_masked $dst_src1, $pg, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fnmsb($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), $pg$$PRegister, $src2$$FloatRegister, $src3$$FloatRegister); diff --git a/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 b/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 index 4a2c5947d1a..cb22e96dc8f 100644 --- a/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 +++ b/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 @@ -1173,14 +1173,14 @@ instruct vmla_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ %} // vector fmla -// dst_src1 = dst_src1 + src2 * src3 +// dst_src1 = src2 * src3 + dst_src1 instruct vfmla(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); match(Set dst_src1 (FmaVF dst_src1 (Binary src2 src3))); match(Set dst_src1 (FmaVD dst_src1 (Binary src2 src3))); format %{ "vfmla $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); uint length_in_bytes = Matcher::vector_length_in_bytes(this); if (VM_Version::use_neon_for_vector(length_in_bytes)) { __ fmla($dst_src1$$FloatRegister, get_arrangement(this), @@ -1199,11 +1199,12 @@ instruct vfmla(vReg dst_src1, vReg src2, vReg src3) %{ // dst_src1 = dst_src1 * src2 + src3 instruct vfmad_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (Binary dst_src1 src2) (Binary src3 pg))); match(Set dst_src1 (FmaVD (Binary dst_src1 src2) (Binary src3 pg))); format %{ "vfmad_masked $dst_src1, $pg, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fmad($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), $pg$$PRegister, $src2$$FloatRegister, $src3$$FloatRegister); @@ -1263,34 +1264,14 @@ instruct vmls_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ // vector fmls -// dst_src1 = dst_src1 + -src2 * src3 -instruct vfmls1(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); - match(Set dst_src1 (FmaVF dst_src1 (Binary (NegVF src2) src3))); - match(Set dst_src1 (FmaVD dst_src1 (Binary (NegVD src2) src3))); - format %{ "vfmls1 $dst_src1, $src2, $src3" %} - ins_encode %{ - uint length_in_bytes = Matcher::vector_length_in_bytes(this); - if (VM_Version::use_neon_for_vector(length_in_bytes)) { - __ fmls($dst_src1$$FloatRegister, get_arrangement(this), - $src2$$FloatRegister, $src3$$FloatRegister); - } else { - assert(UseSVE > 0, "must be sve"); - BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_fmls($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), - ptrue, $src2$$FloatRegister, $src3$$FloatRegister); - } - %} - ins_pipe(pipe_slow); -%} - -// dst_src1 = dst_src1 + src2 * -src3 -instruct vfmls2(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); +// dst_src1 = src2 * (-src3) + dst_src1 +// "(-src2) * src3 + dst_src1" has been idealized to "src3 * (-src2) + dst_src1" +instruct vfmls(vReg dst_src1, vReg src2, vReg src3) %{ match(Set dst_src1 (FmaVF dst_src1 (Binary src2 (NegVF src3)))); match(Set dst_src1 (FmaVD dst_src1 (Binary src2 (NegVD src3)))); - format %{ "vfmls2 $dst_src1, $src2, $src3" %} + format %{ "vfmls $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); uint length_in_bytes = Matcher::vector_length_in_bytes(this); if (VM_Version::use_neon_for_vector(length_in_bytes)) { __ fmls($dst_src1$$FloatRegister, get_arrangement(this), @@ -1307,13 +1288,14 @@ instruct vfmls2(vReg dst_src1, vReg src2, vReg src3) %{ // vector fmsb - predicated -// dst_src1 = dst_src1 * -src2 + src3 +// dst_src1 = dst_src1 * (-src2) + src3 instruct vfmsb_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (Binary dst_src1 (NegVF src2)) (Binary src3 pg))); match(Set dst_src1 (FmaVD (Binary dst_src1 (NegVD src2)) (Binary src3 pg))); format %{ "vfmsb_masked $dst_src1, $pg, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fmsb($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), $pg$$PRegister, $src2$$FloatRegister, $src3$$FloatRegister); @@ -1323,27 +1305,15 @@ instruct vfmsb_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ // vector fnmla (sve) -// dst_src1 = -dst_src1 + -src2 * src3 -instruct vfnmla1(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA && UseSVE > 0); - match(Set dst_src1 (FmaVF (NegVF dst_src1) (Binary (NegVF src2) src3))); - match(Set dst_src1 (FmaVD (NegVD dst_src1) (Binary (NegVD src2) src3))); - format %{ "vfnmla1 $dst_src1, $src2, $src3" %} - ins_encode %{ - BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_fnmla($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), - ptrue, $src2$$FloatRegister, $src3$$FloatRegister); - %} - ins_pipe(pipe_slow); -%} - -// dst_src1 = -dst_src1 + src2 * -src3 -instruct vfnmla2(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA && UseSVE > 0); +// dst_src1 = src2 * (-src3) - dst_src1 +// "(-src2) * src3 - dst_src1" has been idealized to "src3 * (-src2) - dst_src1" +instruct vfnmla(vReg dst_src1, vReg src2, vReg src3) %{ + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (NegVF dst_src1) (Binary src2 (NegVF src3)))); match(Set dst_src1 (FmaVD (NegVD dst_src1) (Binary src2 (NegVD src3)))); - format %{ "vfnmla2 $dst_src1, $src2, $src3" %} + format %{ "vfnmla $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fnmla($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), ptrue, $src2$$FloatRegister, $src3$$FloatRegister); @@ -1353,13 +1323,14 @@ instruct vfnmla2(vReg dst_src1, vReg src2, vReg src3) %{ // vector fnmad - predicated -// dst_src1 = -src3 + dst_src1 * -src2 +// dst_src1 = dst_src1 * (-src2) - src3 instruct vfnmad_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (Binary dst_src1 (NegVF src2)) (Binary (NegVF src3) pg))); match(Set dst_src1 (FmaVD (Binary dst_src1 (NegVD src2)) (Binary (NegVD src3) pg))); format %{ "vfnmad_masked $dst_src1, $pg, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fnmad($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), $pg$$PRegister, $src2$$FloatRegister, $src3$$FloatRegister); @@ -1369,13 +1340,14 @@ instruct vfnmad_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ // vector fnmls (sve) -// dst_src1 = -dst_src1 + src2 * src3 +// dst_src1 = src2 * src3 - dst_src1 instruct vfnmls(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (NegVF dst_src1) (Binary src2 src3))); match(Set dst_src1 (FmaVD (NegVD dst_src1) (Binary src2 src3))); format %{ "vfnmls $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fnmls($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), ptrue, $src2$$FloatRegister, $src3$$FloatRegister); @@ -1385,13 +1357,14 @@ instruct vfnmls(vReg dst_src1, vReg src2, vReg src3) %{ // vector fnmsb - predicated -// dst_src1 = -src3 + dst_src1 * src2 +// dst_src1 = dst_src1 * src2 - src3 instruct vfnmsb_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ - predicate(UseFMA && UseSVE > 0); + predicate(UseSVE > 0); match(Set dst_src1 (FmaVF (Binary dst_src1 src2) (Binary (NegVF src3) pg))); match(Set dst_src1 (FmaVD (Binary dst_src1 src2) (Binary (NegVD src3) pg))); format %{ "vfnmsb_masked $dst_src1, $pg, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ sve_fnmsb($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt), $pg$$PRegister, $src2$$FloatRegister, $src3$$FloatRegister); diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index c8f8bf35f22..89ce51e997e 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -2148,6 +2148,9 @@ bool Matcher::match_rule_supported(int opcode) { return SuperwordUseVSX; case Op_PopCountVI: return (SuperwordUseVSX && UsePopCountInstruction); + case Op_FmaF: + case Op_FmaD: + return UseFMA; case Op_FmaVF: case Op_FmaVD: return (SuperwordUseVSX && UseFMA); @@ -9652,6 +9655,7 @@ instruct maddF_reg_reg(regF dst, regF src1, regF src2, regF src3) %{ format %{ "FMADDS $dst, $src1, $src2, $src3" %} size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmadds($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister); %} ins_pipe(pipe_class_default); @@ -9664,58 +9668,63 @@ instruct maddD_reg_reg(regD dst, regD src1, regD src2, regD src3) %{ format %{ "FMADD $dst, $src1, $src2, $src3" %} size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmadd($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister); %} ins_pipe(pipe_class_default); %} -// -src1 * src2 + src3 = -(src1*src2-src3) +// src1 * (-src2) + src3 = -(src1*src2-src3) +// "(-src1) * src2 + src3" has been idealized to "src2 * (-src1) + src3" instruct mnsubF_reg_reg(regF dst, regF src1, regF src2, regF src3) %{ - match(Set dst (FmaF src3 (Binary (NegF src1) src2))); match(Set dst (FmaF src3 (Binary src1 (NegF src2)))); format %{ "FNMSUBS $dst, $src1, $src2, $src3" %} size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmsubs($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister); %} ins_pipe(pipe_class_default); %} -// -src1 * src2 + src3 = -(src1*src2-src3) +// src1 * (-src2) + src3 = -(src1*src2-src3) +// "(-src1) * src2 + src3" has been idealized to "src2 * (-src1) + src3" instruct mnsubD_reg_reg(regD dst, regD src1, regD src2, regD src3) %{ - match(Set dst (FmaD src3 (Binary (NegD src1) src2))); match(Set dst (FmaD src3 (Binary src1 (NegD src2)))); format %{ "FNMSUB $dst, $src1, $src2, $src3" %} size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmsub($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister); %} ins_pipe(pipe_class_default); %} -// -src1 * src2 - src3 = -(src1*src2+src3) +// src1 * (-src2) - src3 = -(src1*src2+src3) +// "(-src1) * src2 - src3" has been idealized to "src2 * (-src1) - src3" instruct mnaddF_reg_reg(regF dst, regF src1, regF src2, regF src3) %{ - match(Set dst (FmaF (NegF src3) (Binary (NegF src1) src2))); match(Set dst (FmaF (NegF src3) (Binary src1 (NegF src2)))); format %{ "FNMADDS $dst, $src1, $src2, $src3" %} size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmadds($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister); %} ins_pipe(pipe_class_default); %} -// -src1 * src2 - src3 = -(src1*src2+src3) +// src1 * (-src2) - src3 = -(src1*src2+src3) +// "(-src1) * src2 - src3" has been idealized to "src2 * (-src1) - src3" instruct mnaddD_reg_reg(regD dst, regD src1, regD src2, regD src3) %{ - match(Set dst (FmaD (NegD src3) (Binary (NegD src1) src2))); match(Set dst (FmaD (NegD src3) (Binary src1 (NegD src2)))); format %{ "FNMADD $dst, $src1, $src2, $src3" %} size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmadd($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister); %} ins_pipe(pipe_class_default); @@ -9728,6 +9737,7 @@ instruct msubF_reg_reg(regF dst, regF src1, regF src2, regF src3) %{ format %{ "FMSUBS $dst, $src1, $src2, $src3" %} size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmsubs($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister); %} ins_pipe(pipe_class_default); @@ -9740,6 +9750,7 @@ instruct msubD_reg_reg(regD dst, regD src1, regD src2, regD src3) %{ format %{ "FMSUB $dst, $src1, $src2, $src3" %} size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmsub($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister, $src3$$FloatRegister); %} ins_pipe(pipe_class_default); @@ -14057,7 +14068,7 @@ instruct vpopcnt_reg(vecX dst, vecX src) %{ %} // --------------------------------- FMA -------------------------------------- -// dst + src1 * src2 +// src1 * src2 + dst instruct vfma4F(vecX dst, vecX src1, vecX src2) %{ match(Set dst (FmaVF dst (Binary src1 src2))); predicate(n->as_Vector()->length() == 4); @@ -14066,14 +14077,15 @@ instruct vfma4F(vecX dst, vecX src1, vecX src2) %{ size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ xvmaddasp($dst$$VectorSRegister, $src1$$VectorSRegister, $src2$$VectorSRegister); %} ins_pipe(pipe_class_default); %} -// dst - src1 * src2 +// src1 * (-src2) + dst +// "(-src1) * src2 + dst" has been idealized to "src2 * (-src1) + dst" instruct vfma4F_neg1(vecX dst, vecX src1, vecX src2) %{ - match(Set dst (FmaVF dst (Binary (NegVF src1) src2))); match(Set dst (FmaVF dst (Binary src1 (NegVF src2)))); predicate(n->as_Vector()->length() == 4); @@ -14081,12 +14093,13 @@ instruct vfma4F_neg1(vecX dst, vecX src1, vecX src2) %{ size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ xvnmsubasp($dst$$VectorSRegister, $src1$$VectorSRegister, $src2$$VectorSRegister); %} ins_pipe(pipe_class_default); %} -// - dst + src1 * src2 +// src1 * src2 - dst instruct vfma4F_neg2(vecX dst, vecX src1, vecX src2) %{ match(Set dst (FmaVF (NegVF dst) (Binary src1 src2))); predicate(n->as_Vector()->length() == 4); @@ -14095,12 +14108,13 @@ instruct vfma4F_neg2(vecX dst, vecX src1, vecX src2) %{ size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ xvmsubasp($dst$$VectorSRegister, $src1$$VectorSRegister, $src2$$VectorSRegister); %} ins_pipe(pipe_class_default); %} -// dst + src1 * src2 +// src1 * src2 + dst instruct vfma2D(vecX dst, vecX src1, vecX src2) %{ match(Set dst (FmaVD dst (Binary src1 src2))); predicate(n->as_Vector()->length() == 2); @@ -14109,14 +14123,15 @@ instruct vfma2D(vecX dst, vecX src1, vecX src2) %{ size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ xvmaddadp($dst$$VectorSRegister, $src1$$VectorSRegister, $src2$$VectorSRegister); %} ins_pipe(pipe_class_default); %} -// dst - src1 * src2 +// src1 * (-src2) + dst +// "(-src1) * src2 + dst" has been idealized to "src2 * (-src1) + dst" instruct vfma2D_neg1(vecX dst, vecX src1, vecX src2) %{ - match(Set dst (FmaVD dst (Binary (NegVD src1) src2))); match(Set dst (FmaVD dst (Binary src1 (NegVD src2)))); predicate(n->as_Vector()->length() == 2); @@ -14124,12 +14139,13 @@ instruct vfma2D_neg1(vecX dst, vecX src1, vecX src2) %{ size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ xvnmsubadp($dst$$VectorSRegister, $src1$$VectorSRegister, $src2$$VectorSRegister); %} ins_pipe(pipe_class_default); %} -// - dst + src1 * src2 +// src1 * src2 - dst instruct vfma2D_neg2(vecX dst, vecX src1, vecX src2) %{ match(Set dst (FmaVD (NegVD dst) (Binary src1 src2))); predicate(n->as_Vector()->length() == 2); @@ -14138,6 +14154,7 @@ instruct vfma2D_neg2(vecX dst, vecX src1, vecX src2) %{ size(4); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ xvmsubadp($dst$$VectorSRegister, $src1$$VectorSRegister, $src2$$VectorSRegister); %} ins_pipe(pipe_class_default); diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad index 6016c5fe282..d03dc843c2b 100644 --- a/src/hotspot/cpu/riscv/riscv.ad +++ b/src/hotspot/cpu/riscv/riscv.ad @@ -1907,6 +1907,11 @@ bool Matcher::match_rule_supported(int opcode) { case Op_CountTrailingZerosI: case Op_CountTrailingZerosL: return UseZbb; + case Op_FmaF: + case Op_FmaD: + case Op_FmaVF: + case Op_FmaVD: + return UseFMA; } return true; // Per default match rules are supported. @@ -7271,13 +7276,13 @@ instruct mulD_reg_reg(fRegD dst, fRegD src1, fRegD src2) %{ // src1 * src2 + src3 instruct maddF_reg_reg(fRegF dst, fRegF src1, fRegF src2, fRegF src3) %{ - predicate(UseFMA); match(Set dst (FmaF src3 (Binary src1 src2))); ins_cost(FMUL_SINGLE_COST); format %{ "fmadd.s $dst, $src1, $src2, $src3\t#@maddF_reg_reg" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmadd_s(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -7289,13 +7294,13 @@ instruct maddF_reg_reg(fRegF dst, fRegF src1, fRegF src2, fRegF src3) %{ // src1 * src2 + src3 instruct maddD_reg_reg(fRegD dst, fRegD src1, fRegD src2, fRegD src3) %{ - predicate(UseFMA); match(Set dst (FmaD src3 (Binary src1 src2))); ins_cost(FMUL_DOUBLE_COST); format %{ "fmadd.d $dst, $src1, $src2, $src3\t#@maddD_reg_reg" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmadd_d(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -7307,13 +7312,13 @@ instruct maddD_reg_reg(fRegD dst, fRegD src1, fRegD src2, fRegD src3) %{ // src1 * src2 - src3 instruct msubF_reg_reg(fRegF dst, fRegF src1, fRegF src2, fRegF src3) %{ - predicate(UseFMA); match(Set dst (FmaF (NegF src3) (Binary src1 src2))); ins_cost(FMUL_SINGLE_COST); format %{ "fmsub.s $dst, $src1, $src2, $src3\t#@msubF_reg_reg" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmsub_s(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -7325,13 +7330,13 @@ instruct msubF_reg_reg(fRegF dst, fRegF src1, fRegF src2, fRegF src3) %{ // src1 * src2 - src3 instruct msubD_reg_reg(fRegD dst, fRegD src1, fRegD src2, fRegD src3) %{ - predicate(UseFMA); match(Set dst (FmaD (NegD src3) (Binary src1 src2))); ins_cost(FMUL_DOUBLE_COST); format %{ "fmsub.d $dst, $src1, $src2, $src3\t#@msubD_reg_reg" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmsub_d(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -7341,16 +7346,16 @@ instruct msubD_reg_reg(fRegD dst, fRegD src1, fRegD src2, fRegD src3) %{ ins_pipe(pipe_class_default); %} -// -src1 * src2 + src3 +// src1 * (-src2) + src3 +// "(-src1) * src2 + src3" has been idealized to "src2 * (-src1) + src3" instruct nmsubF_reg_reg(fRegF dst, fRegF src1, fRegF src2, fRegF src3) %{ - predicate(UseFMA); - match(Set dst (FmaF src3 (Binary (NegF src1) src2))); match(Set dst (FmaF src3 (Binary src1 (NegF src2)))); ins_cost(FMUL_SINGLE_COST); format %{ "fnmsub.s $dst, $src1, $src2, $src3\t#@nmsubF_reg_reg" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmsub_s(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -7360,16 +7365,16 @@ instruct nmsubF_reg_reg(fRegF dst, fRegF src1, fRegF src2, fRegF src3) %{ ins_pipe(pipe_class_default); %} -// -src1 * src2 + src3 +// src1 * (-src2) + src3 +// "(-src1) * src2 + src3" has been idealized to "src2 * (-src1) + src3" instruct nmsubD_reg_reg(fRegD dst, fRegD src1, fRegD src2, fRegD src3) %{ - predicate(UseFMA); - match(Set dst (FmaD src3 (Binary (NegD src1) src2))); match(Set dst (FmaD src3 (Binary src1 (NegD src2)))); ins_cost(FMUL_DOUBLE_COST); format %{ "fnmsub.d $dst, $src1, $src2, $src3\t#@nmsubD_reg_reg" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmsub_d(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -7379,16 +7384,16 @@ instruct nmsubD_reg_reg(fRegD dst, fRegD src1, fRegD src2, fRegD src3) %{ ins_pipe(pipe_class_default); %} -// -src1 * src2 - src3 +// src1 * (-src2) - src3 +// "(-src1) * src2 - src3" has been idealized to "src2 * (-src1) - src3" instruct nmaddF_reg_reg(fRegF dst, fRegF src1, fRegF src2, fRegF src3) %{ - predicate(UseFMA); - match(Set dst (FmaF (NegF src3) (Binary (NegF src1) src2))); match(Set dst (FmaF (NegF src3) (Binary src1 (NegF src2)))); ins_cost(FMUL_SINGLE_COST); format %{ "fnmadd.s $dst, $src1, $src2, $src3\t#@nmaddF_reg_reg" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmadd_s(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), @@ -7398,16 +7403,16 @@ instruct nmaddF_reg_reg(fRegF dst, fRegF src1, fRegF src2, fRegF src3) %{ ins_pipe(pipe_class_default); %} -// -src1 * src2 - src3 +// src1 * (-src2) - src3 +// "(-src1) * src2 - src3" has been idealized to "src2 * (-src1) - src3" instruct nmaddD_reg_reg(fRegD dst, fRegD src1, fRegD src2, fRegD src3) %{ - predicate(UseFMA); - match(Set dst (FmaD (NegD src3) (Binary (NegD src1) src2))); match(Set dst (FmaD (NegD src3) (Binary src1 (NegD src2)))); ins_cost(FMUL_DOUBLE_COST); format %{ "fnmadd.d $dst, $src1, $src2, $src3\t#@nmaddD_reg_reg" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fnmadd_d(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), diff --git a/src/hotspot/cpu/riscv/riscv_v.ad b/src/hotspot/cpu/riscv/riscv_v.ad index 268a51c327f..a61e59ef96a 100644 --- a/src/hotspot/cpu/riscv/riscv_v.ad +++ b/src/hotspot/cpu/riscv/riscv_v.ad @@ -1,6 +1,6 @@ // -// Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. -// Copyright (c) 2020, Arm Limited. All rights reserved. +// Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2020, 2023, Arm Limited. All rights reserved. // Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // @@ -693,14 +693,14 @@ instruct vmin_fp_masked(vReg dst_src1, vReg src2, vRegMask vmask, vReg tmp1, vRe // vector fmla -// dst_src1 = dst_src1 + src2 * src3 +// dst_src1 = src2 * src3 + dst_src1 instruct vfmla(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); match(Set dst_src1 (FmaVF dst_src1 (Binary src2 src3))); match(Set dst_src1 (FmaVD dst_src1 (Binary src2 src3))); ins_cost(VEC_COST); format %{ "vfmla $dst_src1, $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ vsetvli_helper(bt, Matcher::vector_length(this)); __ vfmacc_vv(as_VectorRegister($dst_src1$$reg), @@ -713,11 +713,11 @@ instruct vfmla(vReg dst_src1, vReg src2, vReg src3) %{ // dst_src1 = dst_src1 * src2 + src3 instruct vfmadd_masked(vReg dst_src1, vReg src2, vReg src3, vRegMask_V0 v0) %{ - predicate(UseFMA); match(Set dst_src1 (FmaVF (Binary dst_src1 src2) (Binary src3 v0))); match(Set dst_src1 (FmaVD (Binary dst_src1 src2) (Binary src3 v0))); format %{ "vfmadd_masked $dst_src1, $dst_src1, $src2, $src3, $v0" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ vsetvli_helper(bt, Matcher::vector_length(this)); __ vfmadd_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), @@ -728,15 +728,14 @@ instruct vfmadd_masked(vReg dst_src1, vReg src2, vReg src3, vRegMask_V0 v0) %{ // vector fmls -// dst_src1 = dst_src1 + -src2 * src3 -// dst_src1 = dst_src1 + src2 * -src3 +// dst_src1 = src2 * (-src3) + dst_src1 +// "(-src2) * src3 + dst_src1" has been idealized to "src3 * (-src2) + dst_src1" instruct vfmlsF(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); - match(Set dst_src1 (FmaVF dst_src1 (Binary (NegVF src2) src3))); match(Set dst_src1 (FmaVF dst_src1 (Binary src2 (NegVF src3)))); ins_cost(VEC_COST); format %{ "vfmlsF $dst_src1, $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ vsetvli_helper(T_FLOAT, Matcher::vector_length(this)); __ vfnmsac_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), as_VectorRegister($src3$$reg)); @@ -744,15 +743,14 @@ instruct vfmlsF(vReg dst_src1, vReg src2, vReg src3) %{ ins_pipe(pipe_slow); %} -// dst_src1 = dst_src1 + -src2 * src3 -// dst_src1 = dst_src1 + src2 * -src3 +// dst_src1 = src2 * (-src3) + dst_src1 +// "(-src2) * src3 + dst_src1" has been idealized to "src3 * (-src2) + dst_src1" instruct vfmlsD(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); - match(Set dst_src1 (FmaVD dst_src1 (Binary (NegVD src2) src3))); match(Set dst_src1 (FmaVD dst_src1 (Binary src2 (NegVD src3)))); ins_cost(VEC_COST); format %{ "vfmlsD $dst_src1, $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ vsetvli_helper(T_DOUBLE, Matcher::vector_length(this)); __ vfnmsac_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), as_VectorRegister($src3$$reg)); @@ -762,13 +760,13 @@ instruct vfmlsD(vReg dst_src1, vReg src2, vReg src3) %{ // vector fnmsub - predicated -// dst_src1 = dst_src1 * -src2 + src3 +// dst_src1 = dst_src1 * (-src2) + src3 instruct vfnmsub_masked(vReg dst_src1, vReg src2, vReg src3, vRegMask_V0 v0) %{ - predicate(UseFMA); match(Set dst_src1 (FmaVF (Binary dst_src1 (NegVF src2)) (Binary src3 v0))); match(Set dst_src1 (FmaVD (Binary dst_src1 (NegVD src2)) (Binary src3 v0))); format %{ "vfnmsub_masked $dst_src1, $dst_src1, $src2, $src3, $v0" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ vsetvli_helper(bt, Matcher::vector_length(this)); __ vfnmsub_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), @@ -779,15 +777,14 @@ instruct vfnmsub_masked(vReg dst_src1, vReg src2, vReg src3, vRegMask_V0 v0) %{ // vector fnmla -// dst_src1 = -dst_src1 + -src2 * src3 -// dst_src1 = -dst_src1 + src2 * -src3 +// dst_src1 = src2 * (-src3) - dst_src1 +// "(-src2) * src3 - dst_src1" has been idealized to "src3 * (-src2) - dst_src1" instruct vfnmlaF(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); - match(Set dst_src1 (FmaVF (NegVF dst_src1) (Binary (NegVF src2) src3))); match(Set dst_src1 (FmaVF (NegVF dst_src1) (Binary src2 (NegVF src3)))); ins_cost(VEC_COST); format %{ "vfnmlaF $dst_src1, $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ vsetvli_helper(T_FLOAT, Matcher::vector_length(this)); __ vfnmacc_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), as_VectorRegister($src3$$reg)); @@ -795,15 +792,14 @@ instruct vfnmlaF(vReg dst_src1, vReg src2, vReg src3) %{ ins_pipe(pipe_slow); %} -// dst_src1 = -dst_src1 + -src2 * src3 -// dst_src1 = -dst_src1 + src2 * -src3 +// dst_src1 = src2 * (-src3) - dst_src1 +// "(-src2) * src3 - dst_src1" has been idealized to "src3 * (-src2) - dst_src1" instruct vfnmlaD(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); - match(Set dst_src1 (FmaVD (NegVD dst_src1) (Binary (NegVD src2) src3))); match(Set dst_src1 (FmaVD (NegVD dst_src1) (Binary src2 (NegVD src3)))); ins_cost(VEC_COST); format %{ "vfnmlaD $dst_src1, $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ vsetvli_helper(T_DOUBLE, Matcher::vector_length(this)); __ vfnmacc_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), as_VectorRegister($src3$$reg)); @@ -813,13 +809,13 @@ instruct vfnmlaD(vReg dst_src1, vReg src2, vReg src3) %{ // vector fnmadd - predicated -// dst_src1 = -src3 + dst_src1 * -src2 +// dst_src1 = dst_src1 * (-src2) - src3 instruct vfnmadd_masked(vReg dst_src1, vReg src2, vReg src3, vRegMask_V0 v0) %{ - predicate(UseFMA); match(Set dst_src1 (FmaVF (Binary dst_src1 (NegVF src2)) (Binary (NegVF src3) v0))); match(Set dst_src1 (FmaVD (Binary dst_src1 (NegVD src2)) (Binary (NegVD src3) v0))); format %{ "vfnmadd_masked $dst_src1, $dst_src1, $src2, $src3, $v0" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ vsetvli_helper(bt, Matcher::vector_length(this)); __ vfnmadd_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), @@ -830,13 +826,13 @@ instruct vfnmadd_masked(vReg dst_src1, vReg src2, vReg src3, vRegMask_V0 v0) %{ // vector fnmls -// dst_src1 = -dst_src1 + src2 * src3 +// dst_src1 = src2 * src3 - dst_src1 instruct vfnmlsF(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); match(Set dst_src1 (FmaVF (NegVF dst_src1) (Binary src2 src3))); ins_cost(VEC_COST); format %{ "vfnmlsF $dst_src1, $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ vsetvli_helper(T_FLOAT, Matcher::vector_length(this)); __ vfmsac_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), as_VectorRegister($src3$$reg)); @@ -846,11 +842,11 @@ instruct vfnmlsF(vReg dst_src1, vReg src2, vReg src3) %{ // dst_src1 = -dst_src1 + src2 * src3 instruct vfnmlsD(vReg dst_src1, vReg src2, vReg src3) %{ - predicate(UseFMA); match(Set dst_src1 (FmaVD (NegVD dst_src1) (Binary src2 src3))); ins_cost(VEC_COST); format %{ "vfnmlsD $dst_src1, $dst_src1, $src2, $src3" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ vsetvli_helper(T_DOUBLE, Matcher::vector_length(this)); __ vfmsac_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), as_VectorRegister($src3$$reg)); @@ -860,13 +856,13 @@ instruct vfnmlsD(vReg dst_src1, vReg src2, vReg src3) %{ // vector vfmsub - predicated -// dst_src1 = -src3 + dst_src1 * src2 +// dst_src1 = dst_src1 * src2 - src3 instruct vfmsub_masked(vReg dst_src1, vReg src2, vReg src3, vRegMask_V0 v0) %{ - predicate(UseFMA); match(Set dst_src1 (FmaVF (Binary dst_src1 src2) (Binary (NegVF src3) v0))); match(Set dst_src1 (FmaVD (Binary dst_src1 src2) (Binary (NegVD src3) v0))); format %{ "vfmsub_masked $dst_src1, $dst_src1, $src2, $src3, $v0" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); BasicType bt = Matcher::vector_element_basic_type(this); __ vsetvli_helper(bt, Matcher::vector_length(this)); __ vfmsub_vv(as_VectorRegister($dst_src1$$reg), as_VectorRegister($src2$$reg), diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad index 6982349b3b5..ffac6b70a58 100644 --- a/src/hotspot/cpu/s390/s390.ad +++ b/src/hotspot/cpu/s390/s390.ad @@ -1505,6 +1505,9 @@ bool Matcher::match_rule_supported(int opcode) { case Op_PopCountL: // PopCount supported by H/W from z/Architecture G5 (z196) on. return (UsePopCountInstruction && VM_Version::has_PopCount()); + case Op_FmaF: + case Op_FmaD: + return UseFMA; } return true; // Per default match rules are supported. @@ -7160,6 +7163,7 @@ instruct maddF_reg_reg(regF dst, regF src1, regF src2) %{ size(4); format %{ "MAEBR $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_maebr($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister); %} ins_pipe(pipe_class_dummy); @@ -7173,6 +7177,7 @@ instruct maddD_reg_reg(regD dst, regD src1, regD src2) %{ size(4); format %{ "MADBR $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_madbr($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister); %} ins_pipe(pipe_class_dummy); @@ -7186,6 +7191,7 @@ instruct msubF_reg_reg(regF dst, regF src1, regF src2) %{ size(4); format %{ "MSEBR $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_msebr($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister); %} ins_pipe(pipe_class_dummy); @@ -7199,6 +7205,7 @@ instruct msubD_reg_reg(regD dst, regD src1, regD src2) %{ size(4); format %{ "MSDBR $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_msdbr($dst$$FloatRegister, $src1$$FloatRegister, $src2$$FloatRegister); %} ins_pipe(pipe_class_dummy); @@ -7212,6 +7219,7 @@ instruct maddF_reg_mem(regF dst, regF src1, memoryRX src2) %{ size(6); format %{ "MAEB $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_maeb($dst$$FloatRegister, $src1$$FloatRegister, Address(reg_to_register_object($src2$$base), $src2$$index$$Register, $src2$$disp)); %} @@ -7226,6 +7234,7 @@ instruct maddD_reg_mem(regD dst, regD src1, memoryRX src2) %{ size(6); format %{ "MADB $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_madb($dst$$FloatRegister, $src1$$FloatRegister, Address(reg_to_register_object($src2$$base), $src2$$index$$Register, $src2$$disp)); %} @@ -7240,6 +7249,7 @@ instruct msubF_reg_mem(regF dst, regF src1, memoryRX src2) %{ size(6); format %{ "MSEB $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_mseb($dst$$FloatRegister, $src1$$FloatRegister, Address(reg_to_register_object($src2$$base), $src2$$index$$Register, $src2$$disp)); %} @@ -7254,6 +7264,7 @@ instruct msubD_reg_mem(regD dst, regD src1, memoryRX src2) %{ size(6); format %{ "MSDB $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_msdb($dst$$FloatRegister, $src1$$FloatRegister, Address(reg_to_register_object($src2$$base), $src2$$index$$Register, $src2$$disp)); %} @@ -7268,6 +7279,7 @@ instruct maddF_mem_reg(regF dst, memoryRX src1, regF src2) %{ size(6); format %{ "MAEB $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_maeb($dst$$FloatRegister, $src2$$FloatRegister, Address(reg_to_register_object($src1$$base), $src1$$index$$Register, $src1$$disp)); %} @@ -7282,6 +7294,7 @@ instruct maddD_mem_reg(regD dst, memoryRX src1, regD src2) %{ size(6); format %{ "MADB $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_madb($dst$$FloatRegister, $src2$$FloatRegister, Address(reg_to_register_object($src1$$base), $src1$$index$$Register, $src1$$disp)); %} @@ -7296,6 +7309,7 @@ instruct msubF_mem_reg(regF dst, memoryRX src1, regF src2) %{ size(6); format %{ "MSEB $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_mseb($dst$$FloatRegister, $src2$$FloatRegister, Address(reg_to_register_object($src1$$base), $src1$$index$$Register, $src1$$disp)); %} @@ -7310,6 +7324,7 @@ instruct msubD_mem_reg(regD dst, memoryRX src1, regD src2) %{ size(6); format %{ "MSDB $dst, $src1, $src2" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ z_msdb($dst$$FloatRegister, $src2$$FloatRegister, Address(reg_to_register_object($src1$$base), $src1$$index$$Register, $src1$$disp)); %} diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 3147857d249..61ab92326b2 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -1566,6 +1566,8 @@ bool Matcher::match_rule_supported(int opcode) { return false; } break; + case Op_FmaF: + case Op_FmaD: case Op_FmaVD: case Op_FmaVF: if (!UseFMA) { @@ -3960,11 +3962,11 @@ instruct onspinwait() %{ // a * b + c instruct fmaD_reg(regD a, regD b, regD c) %{ - predicate(UseFMA); match(Set c (FmaD c (Binary a b))); format %{ "fmasd $a,$b,$c\t# $c = $a * $b + $c" %} ins_cost(150); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmad($c$$XMMRegister, $a$$XMMRegister, $b$$XMMRegister, $c$$XMMRegister); %} ins_pipe( pipe_slow ); @@ -3972,11 +3974,11 @@ instruct fmaD_reg(regD a, regD b, regD c) %{ // a * b + c instruct fmaF_reg(regF a, regF b, regF c) %{ - predicate(UseFMA); match(Set c (FmaF c (Binary a b))); format %{ "fmass $a,$b,$c\t# $c = $a * $b + $c" %} ins_cost(150); ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); __ fmaf($c$$XMMRegister, $a$$XMMRegister, $b$$XMMRegister, $c$$XMMRegister); %} ins_pipe( pipe_slow ); @@ -9864,6 +9866,7 @@ instruct vfma_reg_masked(vec dst, vec src2, vec src3, kReg mask) %{ match(Set dst (FmaVD (Binary dst src2) (Binary src3 mask))); format %{ "vfma_masked $dst, $src2, $src3, $mask \t! vfma masked operation" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); int vlen_enc = vector_length_encoding(this); BasicType bt = Matcher::vector_element_basic_type(this); int opc = this->ideal_Opcode(); @@ -9878,6 +9881,7 @@ instruct vfma_mem_masked(vec dst, vec src2, memory src3, kReg mask) %{ match(Set dst (FmaVD (Binary dst src2) (Binary (LoadVector src3) mask))); format %{ "vfma_masked $dst, $src2, $src3, $mask \t! vfma masked operation" %} ins_encode %{ + assert(UseFMA, "Needs FMA instructions support."); int vlen_enc = vector_length_encoding(this); BasicType bt = Matcher::vector_element_basic_type(this); int opc = this->ideal_Opcode(); diff --git a/src/hotspot/share/opto/c2compiler.cpp b/src/hotspot/share/opto/c2compiler.cpp index 398eb80b8cf..ea56e30ed87 100644 --- a/src/hotspot/share/opto/c2compiler.cpp +++ b/src/hotspot/share/opto/c2compiler.cpp @@ -502,10 +502,10 @@ bool C2Compiler::is_intrinsic_supported(vmIntrinsics::ID id) { if (!Matcher::match_rule_supported(Op_OnSpinWait)) return false; break; case vmIntrinsics::_fmaD: - if (!UseFMA || !Matcher::match_rule_supported(Op_FmaD)) return false; + if (!Matcher::match_rule_supported(Op_FmaD)) return false; break; case vmIntrinsics::_fmaF: - if (!UseFMA || !Matcher::match_rule_supported(Op_FmaF)) return false; + if (!Matcher::match_rule_supported(Op_FmaF)) return false; break; case vmIntrinsics::_isDigit: if (!Matcher::match_rule_supported(Op_Digit)) return false; diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp index e79492a62e8..6709f831447 100644 --- a/src/hotspot/share/opto/mulnode.cpp +++ b/src/hotspot/share/opto/mulnode.cpp @@ -1711,6 +1711,20 @@ const Type* URShiftLNode::Value(PhaseGVN* phase) const { return TypeLong::LONG; // Give up } +//============================================================================= +//------------------------------Ideal------------------------------------------ +Node* FmaNode::Ideal(PhaseGVN* phase, bool can_reshape) { + // We canonicalize the node by converting "(-a)*b+c" into "b*(-a)+c" + // This reduces the number of rules in the matcher, as we only need to check + // for negations on the second argument, and not the symmetric case where + // the first argument is negated. + if (in(1)->is_Neg() && !in(2)->is_Neg()) { + swap_edges(1, 2); + return this; + } + return nullptr; +} + //============================================================================= //------------------------------Value------------------------------------------ const Type* FmaDNode::Value(PhaseGVN* phase) const { diff --git a/src/hotspot/share/opto/mulnode.hpp b/src/hotspot/share/opto/mulnode.hpp index 84307fb00fb..d04648ee61a 100644 --- a/src/hotspot/share/opto/mulnode.hpp +++ b/src/hotspot/share/opto/mulnode.hpp @@ -357,24 +357,34 @@ class URShiftLNode : public Node { virtual uint ideal_reg() const { return Op_RegL; } }; +//------------------------------FmaNode-------------------------------------- +// fused-multiply-add +class FmaNode : public Node { +public: + FmaNode(Node* c, Node* in1, Node* in2, Node* in3) : Node(c, in1, in2, in3) { + assert(UseFMA, "Needs FMA instructions support."); + } + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); +}; + //------------------------------FmaDNode-------------------------------------- // fused-multiply-add double -class FmaDNode : public Node { +class FmaDNode : public FmaNode { public: - FmaDNode(Node *c, Node *in1, Node *in2, Node *in3) : Node(c, in1, in2, in3) {} + FmaDNode(Node* c, Node* in1, Node* in2, Node* in3) : FmaNode(c, in1, in2, in3) {} virtual int Opcode() const; - const Type *bottom_type() const { return Type::DOUBLE; } + const Type* bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type* Value(PhaseGVN* phase) const; }; //------------------------------FmaFNode-------------------------------------- // fused-multiply-add float -class FmaFNode : public Node { +class FmaFNode : public FmaNode { public: - FmaFNode(Node *c, Node *in1, Node *in2, Node *in3) : Node(c, in1, in2, in3) {} + FmaFNode(Node* c, Node* in1, Node* in2, Node* in3) : FmaNode(c, in1, in2, in3) {} virtual int Opcode() const; - const Type *bottom_type() const { return Type::FLOAT; } + const Type* bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } virtual const Type* Value(PhaseGVN* phase) const; }; diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index 755374e18a9..50134fe0e02 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -129,6 +129,8 @@ class MoveNode; class MulNode; class MultiNode; class MultiBranchNode; +class NegNode; +class NegVNode; class NeverBranchNode; class Opaque1Node; class OuterStripMinedLoopNode; @@ -725,6 +727,7 @@ class Node { DEFINE_CLASS_ID(CompressM, Vector, 6) DEFINE_CLASS_ID(Reduction, Vector, 7) DEFINE_CLASS_ID(UnorderedReduction, Reduction, 0) + DEFINE_CLASS_ID(NegV, Vector, 8) DEFINE_CLASS_ID(Con, Type, 8) DEFINE_CLASS_ID(ConI, Con, 0) DEFINE_CLASS_ID(SafePointScalarMerge, Type, 9) @@ -780,8 +783,9 @@ class Node { DEFINE_CLASS_ID(Opaque1, Node, 16) DEFINE_CLASS_ID(Move, Node, 17) DEFINE_CLASS_ID(LShift, Node, 18) + DEFINE_CLASS_ID(Neg, Node, 19) - _max_classes = ClassMask_LShift + _max_classes = ClassMask_Neg }; #undef DEFINE_CLASS_ID @@ -941,6 +945,8 @@ class Node { DEFINE_CLASS_QUERY(Mul) DEFINE_CLASS_QUERY(Multi) DEFINE_CLASS_QUERY(MultiBranch) + DEFINE_CLASS_QUERY(Neg) + DEFINE_CLASS_QUERY(NegV) DEFINE_CLASS_QUERY(NeverBranch) DEFINE_CLASS_QUERY(Opaque1) DEFINE_CLASS_QUERY(OuterStripMinedLoop) diff --git a/src/hotspot/share/opto/subnode.hpp b/src/hotspot/share/opto/subnode.hpp index a4edeb4053f..f424e258db2 100644 --- a/src/hotspot/share/opto/subnode.hpp +++ b/src/hotspot/share/opto/subnode.hpp @@ -430,7 +430,9 @@ class CmpLTMaskNode : public Node { //------------------------------NegNode---------------------------------------- class NegNode : public Node { public: - NegNode( Node *in1 ) : Node(0,in1) {} + NegNode(Node* in1) : Node(0, in1) { + init_class_id(Class_Neg); + } }; //------------------------------NegINode--------------------------------------- diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index 00926f6ab2f..8b6ba1f5cb9 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -1876,6 +1876,21 @@ Node* VectorLongToMaskNode::Ideal(PhaseGVN* phase, bool can_reshape) { return nullptr; } +Node* FmaVNode::Ideal(PhaseGVN* phase, bool can_reshape) { + // We canonicalize the node by converting "(-a)*b+c" into "b*(-a)+c" + // This reduces the number of rules in the matcher, as we only need to check + // for negations on the second argument, and not the symmetric case where + // the first argument is negated. + // We cannot do this if the FmaV is masked, since the inactive lanes have to return + // the first input (i.e. "-a"). If we were to swap the inputs, the inactive lanes would + // incorrectly return "b". + if (!is_predicated_vector() && in(1)->is_NegV() && !in(2)->is_NegV()) { + swap_edges(1, 2); + return this; + } + return nullptr; +} + // Generate other vector nodes to implement the masked/non-masked vector negation. Node* NegVNode::degenerate_integral_negate(PhaseGVN* phase, bool is_predicated) { const TypeVect* vt = vect_type(); diff --git a/src/hotspot/share/opto/vectornode.hpp b/src/hotspot/share/opto/vectornode.hpp index 3ac54c5d535..fbe9b939991 100644 --- a/src/hotspot/share/opto/vectornode.hpp +++ b/src/hotspot/share/opto/vectornode.hpp @@ -376,19 +376,29 @@ class MulAddVS2VINode : public VectorNode { virtual int Opcode() const; }; +//------------------------------FmaVNode-------------------------------------- +// Vector fused-multiply-add +class FmaVNode : public VectorNode { +public: + FmaVNode(Node* in1, Node* in2, Node* in3, const TypeVect* vt) : VectorNode(in1, in2, in3, vt) { + assert(UseFMA, "Needs FMA instructions support."); + } + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); +}; + //------------------------------FmaVDNode-------------------------------------- -// Vector multiply double -class FmaVDNode : public VectorNode { +// Vector fused-multiply-add double +class FmaVDNode : public FmaVNode { public: - FmaVDNode(Node* in1, Node* in2, Node* in3, const TypeVect* vt) : VectorNode(in1, in2, in3, vt) {} + FmaVDNode(Node* in1, Node* in2, Node* in3, const TypeVect* vt) : FmaVNode(in1, in2, in3, vt) {} virtual int Opcode() const; }; //------------------------------FmaVFNode-------------------------------------- -// Vector multiply float -class FmaVFNode : public VectorNode { +// Vector fused-multiply-add float +class FmaVFNode : public FmaVNode { public: - FmaVFNode(Node* in1, Node* in2, Node* in3, const TypeVect* vt) : VectorNode(in1, in2, in3, vt) {} + FmaVFNode(Node* in1, Node* in2, Node* in3, const TypeVect* vt) : FmaVNode(in1, in2, in3, vt) {} virtual int Opcode() const; }; @@ -508,7 +518,9 @@ class AbsVDNode : public VectorNode { // Vector Neg parent class (not for code generation). class NegVNode : public VectorNode { public: - NegVNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {} + NegVNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) { + init_class_id(Class_NegV); + } virtual int Opcode() const = 0; virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestIRFma.java b/test/hotspot/jtreg/compiler/c2/irTests/TestIRFma.java new file mode 100644 index 00000000000..0e2cd067a13 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestIRFma.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2023, Arm Limited. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2.irTests; + +import compiler.lib.ir_framework.*; +import java.util.Random; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; + +/* + * @test + * @bug 8308340 + * @key randomness + * @summary Test fma match rule after C2 optimizer. + * @library /test/lib / + * @run driver compiler.c2.irTests.TestIRFma + */ + +public class TestIRFma { + + private static final Random RANDOM = Utils.getRandomInstance(); + + public static void main(String[] args) { + TestFramework.run(); + } + + @Run(test = {"test1", "test2", "test3", + "test4", "test5", "test6", + "test7", "test8", "test9", + "test10", "test11", "test12", + "test13", "test14"}) + public void runMethod() { + float fa = RANDOM.nextFloat(); + float fb = RANDOM.nextFloat(); + float fc = RANDOM.nextFloat(); + assertResult(fa, fb, fc); + + double da = RANDOM.nextDouble(); + double db = RANDOM.nextDouble(); + double dc = RANDOM.nextDouble(); + assertResult(da, db, dc); + } + + @DontCompile + public void assertResult(float a, float b, float c) { + Asserts.assertEquals(Math.fma(-a, -b, c) , test1(a, b, c)); + Asserts.assertEquals(Math.fma(-a, b, c) , test3(a, b, c)); + Asserts.assertEquals(Math.fma(a, -b, c) , test5(a, b, c)); + Asserts.assertEquals(Math.fma(-a, b, -c) , test7(a, b, c)); + Asserts.assertEquals(Math.fma(a, -b, -c) , test9(a, b, c)); + Asserts.assertEquals(Math.fma(a, b, -c) , test11(a, b, c)); + Asserts.assertEquals(Math.fma(-a, -b, -c) , test13(a, b, c)); + } + + @DontCompile + public void assertResult(double a, double b, double c) { + Asserts.assertEquals(Math.fma(-a, -b, c) , test2(a, b, c)); + Asserts.assertEquals(Math.fma(-a, b, c) , test4(a, b, c)); + Asserts.assertEquals(Math.fma(a, -b, c) , test6(a, b, c)); + Asserts.assertEquals(Math.fma(-a, b, -c) , test8(a, b, c)); + Asserts.assertEquals(Math.fma(a, -b, -c) , test10(a, b, c)); + Asserts.assertEquals(Math.fma(a, b, -c) , test12(a, b, c)); + Asserts.assertEquals(Math.fma(-a, -b, -c) , test14(a, b, c)); + } + + @Test + @IR(counts = {IRNode.FMSUB, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static float test1(float a, float b, float c) { + return Math.fma(-a, -b, c); + } + + @Test + @IR(counts = {IRNode.FMSUB, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static double test2(double a, double b, double c) { + return Math.fma(-a, -b, c); + } + + @Test + @IR(counts = {IRNode.FMSUB, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static float test3(float a, float b, float c) { + return Math.fma(-a, b, c); + } + + @Test + @IR(counts = {IRNode.FMSUB, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static double test4(double a, double b, double c) { + return Math.fma(-a, b, c); + } + + @Test + @IR(counts = {IRNode.FMSUB, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static float test5(float a, float b, float c) { + return Math.fma(a, -b, c); + } + + @Test + @IR(counts = {IRNode.FMSUB, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static double test6(double a, double b, double c) { + return Math.fma(a, -b, c); + } + + @Test + @IR(counts = {IRNode.FNMADD, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static float test7(float a, float b, float c) { + return Math.fma(-a, b, -c); + } + + @Test + @IR(counts = {IRNode.FNMADD, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static double test8(double a, double b, double c) { + return Math.fma(-a, b, -c); + } + + @Test + @IR(counts = {IRNode.FNMADD, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static float test9(float a, float b, float c) { + return Math.fma(a, -b, -c); + } + + @Test + @IR(counts = {IRNode.FNMADD, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static double test10(double a, double b, double c) { + return Math.fma(a, -b, -c); + } + + @Test + @IR(counts = {IRNode.FNMSUB, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static float test11(float a, float b, float c) { + return Math.fma(a, b, -c); + } + + @Test + @IR(counts = {IRNode.FNMSUB, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static double test12(double a, double b, double c) { + return Math.fma(a, b, -c); + } + + @Test + @IR(counts = {IRNode.FNMADD, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static float test13(float a, float b, float c) { + return Math.fma(-a, -b, -c); + } + + @Test + @IR(counts = {IRNode.FNMADD, "> 0"}, + applyIfCPUFeature = {"asimd", "true"}) + static double test14(double a, double b, double c) { + return Math.fma(-a, -b, -c); + } + + } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index 89900a639ee..cbd95fcac24 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -1388,6 +1388,11 @@ public class IRNode { machOnlyNameRegex(VFNMSB_MASKED, "vfnmsb_masked"); } + public static final String VFMAD_MASKED = PREFIX + "VFMAD_MASKED" + POSTFIX; + static { + machOnlyNameRegex(VFMAD_MASKED, "vfmad_masked"); + } + public static final String VMASK_AND_NOT_L = PREFIX + "VMASK_AND_NOT_L" + POSTFIX; static { machOnlyNameRegex(VMASK_AND_NOT_L, "vmask_and_notL"); @@ -1403,6 +1408,36 @@ public class IRNode { machOnlyNameRegex(VMLA_MASKED, "vmla_masked"); } + public static final String FMSUB = PREFIX + "FMSUB" + POSTFIX; + static { + machOnlyNameRegex(FMSUB, "msub(F|D)_reg_reg"); + } + + public static final String FNMADD = PREFIX + "FNMADD" + POSTFIX; + static { + machOnlyNameRegex(FNMADD, "mnadd(F|D)_reg_reg"); + } + + public static final String FNMSUB = PREFIX + "FNMSUB" + POSTFIX; + static { + machOnlyNameRegex(FNMSUB, "mnsub(F|D)_reg_reg"); + } + + public static final String VFMLA = PREFIX + "VFMLA" + POSTFIX; + static { + machOnlyNameRegex(VFMLA, "vfmla"); + } + + public static final String VFMLS = PREFIX + "VFMLS" + POSTFIX; + static { + machOnlyNameRegex(VFMLS, "vfmls"); + } + + public static final String VFNMLA = PREFIX + "VFNMLA" + POSTFIX; + static { + machOnlyNameRegex(VFNMLA, "vfnmla"); + } + public static final String VMLS = PREFIX + "VMLS" + POSTFIX; static { machOnlyNameRegex(VMLS, "vmls"); diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorFusedMultiplyAddSubTest.java b/test/hotspot/jtreg/compiler/vectorapi/VectorFusedMultiplyAddSubTest.java index ece446bd197..cc65fa69e5d 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/VectorFusedMultiplyAddSubTest.java +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorFusedMultiplyAddSubTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Arm Limited. All rights reserved. + * Copyright (c) 2022, 2023, Arm Limited. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ public class VectorFusedMultiplyAddSubTest { private static final VectorSpecies L_SPECIES = LongVector.SPECIES_MAX; private static final VectorSpecies S_SPECIES = ShortVector.SPECIES_MAX; - private static int LENGTH = 1024; + private static int LENGTH = 128; private static final Random RD = Utils.getRandomInstance(); private static byte[] ba; @@ -223,6 +223,26 @@ private static void assertArrayEquals(double[] r, double[] a, double[] b, double } } + private static void assertArrayEqualsNeg(float[] r, float[] a, float[] b, float[] c, boolean[] m, FTenOp f) { + for (int i = 0; i < LENGTH; i++) { + if (m[i % F_SPECIES.length()]) { + Asserts.assertEquals(f.apply(a[i], b[i], c[i]), r[i]); + } else { + Asserts.assertEquals(-a[i], r[i]); + } + } + } + + private static void assertArrayEqualsNeg(double[] r, double[] a, double[] b, double[] c, boolean[] m, DTenOp f) { + for (int i = 0; i < LENGTH; i++) { + if (m[i % D_SPECIES.length()]) { + Asserts.assertEquals(f.apply(a[i], b[i], c[i]), r[i]); + } else { + Asserts.assertEquals(-a[i], r[i]); + } + } + } + @Test @IR(counts = { IRNode.VMLA_MASKED, ">= 1" }) public static void testByteMultiplyAddMasked() { @@ -340,6 +360,19 @@ public static void testFloatMultiplySubMasked() { assertArrayEquals(fr, fa, fb, fc, m, (a, b, c) -> (float) Math.fma(a, -b, c)); } + @Test + @IR(counts = { IRNode.VFMAD_MASKED, ">= 1" }) + public static void testFloatMultiplyNegAMasked() { + VectorMask mask = VectorMask.fromArray(F_SPECIES, m, 0); + for (int i = 0; i < LENGTH; i += F_SPECIES.length()) { + FloatVector av = FloatVector.fromArray(F_SPECIES, fa, i); + FloatVector bv = FloatVector.fromArray(F_SPECIES, fb, i); + FloatVector cv = FloatVector.fromArray(F_SPECIES, fc, i); + av.neg().lanewise(VectorOperators.FMA, bv, cv, mask).intoArray(fr, i); + } + assertArrayEqualsNeg(fr, fa, fb, fc, m, (a, b, c) -> (float) Math.fma(-a, b, c)); + } + @Test @IR(counts = { IRNode.VFNMAD_MASKED, ">= 1" }) public static void testFloatNegatedMultiplyAddMasked() { @@ -353,6 +386,19 @@ public static void testFloatNegatedMultiplyAddMasked() { assertArrayEquals(fr, fa, fb, fc, m, (a, b, c) -> (float) Math.fma(a, -b, -c)); } + @Test + @IR(counts = { IRNode.VFNMSB_MASKED, ">= 1" }) + public static void testFloatNegatedMultiplyNegAMasked() { + VectorMask mask = VectorMask.fromArray(F_SPECIES, m, 0); + for (int i = 0; i < LENGTH; i += F_SPECIES.length()) { + FloatVector av = FloatVector.fromArray(F_SPECIES, fa, i); + FloatVector bv = FloatVector.fromArray(F_SPECIES, fb, i); + FloatVector cv = FloatVector.fromArray(F_SPECIES, fc, i); + av.neg().lanewise(VectorOperators.FMA, bv, cv.neg(), mask).intoArray(fr, i); + } + assertArrayEqualsNeg(fr, fa, fb, fc, m, (a, b, c) -> (float) Math.fma(-a, b, -c)); + } + @Test @IR(counts = { IRNode.VFNMSB_MASKED, ">= 1" }) public static void testFloatNegatedMultiplySubMasked() { @@ -379,6 +425,19 @@ public static void testDoubleMultiplySubMasked() { assertArrayEquals(dr, da, db, dc, m, (a, b, c) -> (double) Math.fma(a, -b, c)); } + @Test + @IR(counts = { IRNode.VFMAD_MASKED, ">= 1" }) + public static void testDoubleMultiplyNegAMasked() { + VectorMask mask = VectorMask.fromArray(D_SPECIES, m, 0); + for (int i = 0; i < LENGTH; i += D_SPECIES.length()) { + DoubleVector av = DoubleVector.fromArray(D_SPECIES, da, i); + DoubleVector bv = DoubleVector.fromArray(D_SPECIES, db, i); + DoubleVector cv = DoubleVector.fromArray(D_SPECIES, dc, i); + av.neg().lanewise(VectorOperators.FMA, bv, cv, mask).intoArray(dr, i); + } + assertArrayEqualsNeg(dr, da, db, dc, m, (a, b, c) -> (double) Math.fma(-a, b, c)); + } + @Test @IR(counts = { IRNode.VFNMAD_MASKED, ">= 1" }) public static void testDoubleNegatedMultiplyAddMasked() { @@ -392,6 +451,19 @@ public static void testDoubleNegatedMultiplyAddMasked() { assertArrayEquals(dr, da, db, dc, m, (a, b, c) -> (double) Math.fma(a, -b, -c)); } + @Test + @IR(counts = { IRNode.VFNMSB_MASKED, ">= 1" }) + public static void testDoubleNegatedMultiplyNegAMasked() { + VectorMask mask = VectorMask.fromArray(D_SPECIES, m, 0); + for (int i = 0; i < LENGTH; i += D_SPECIES.length()) { + DoubleVector av = DoubleVector.fromArray(D_SPECIES, da, i); + DoubleVector bv = DoubleVector.fromArray(D_SPECIES, db, i); + DoubleVector cv = DoubleVector.fromArray(D_SPECIES, dc, i); + av.neg().lanewise(VectorOperators.FMA, bv, cv.neg(), mask).intoArray(dr, i); + } + assertArrayEqualsNeg(dr, da, db, dc, m, (a, b, c) -> (double) Math.fma(-a, b, -c)); + } + @Test @IR(counts = { IRNode.VFNMSB_MASKED, ">= 1" }) public static void testDoubleNegatedMultiplySubMasked() { @@ -406,7 +478,9 @@ public static void testDoubleNegatedMultiplySubMasked() { } public static void main(String[] args) { - TestFramework.runWithFlags("--add-modules=jdk.incubator.vector", - "-XX:UseSVE=1"); + TestFramework testFramework = new TestFramework(); + testFramework.setDefaultWarmup(5000) + .addFlags("--add-modules=jdk.incubator.vector", "-XX:UseSVE=1") + .start(); } } diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java index 9bb0c670c55..60dc8a5e148 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java @@ -197,7 +197,7 @@ public double[] vectorMin() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_V, ">0", IRNode.VFMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public double[] vectorMulAdd() { @@ -210,7 +210,7 @@ public double[] vectorMulAdd() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_V, ">0", IRNode.VFMLS, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public double[] vectorMulSub1() { @@ -223,7 +223,7 @@ public double[] vectorMulSub1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_V, ">0", IRNode.VFMLS, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public double[] vectorMulSub2() { @@ -237,6 +237,8 @@ public double[] vectorMulSub2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, counts = {IRNode.FMA_V, ">0"}) + @IR(applyIfCPUFeature = {"sve", "true"}, + counts = {IRNode.VFNMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public double[] vectorNegateMulAdd1() { @@ -250,6 +252,8 @@ public double[] vectorNegateMulAdd1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, counts = {IRNode.FMA_V, ">0"}) + @IR(applyIfCPUFeature = {"sve", "true"}, + counts = {IRNode.VFNMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public double[] vectorNegateMulAdd2() { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java index a07fcfa9ca2..b52fb5a1364 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java @@ -164,7 +164,7 @@ public float[] vectorMin() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_V, ">0", IRNode.VFMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public float[] vectorMulAdd() { @@ -177,7 +177,7 @@ public float[] vectorMulAdd() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_V, ">0", IRNode.VFMLS, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public float[] vectorMulSub1() { @@ -190,7 +190,7 @@ public float[] vectorMulSub1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_V, ">0", IRNode.VFMLS, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public float[] vectorMulSub2() { @@ -204,6 +204,8 @@ public float[] vectorMulSub2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, counts = {IRNode.FMA_V, ">0"}) + @IR(applyIfCPUFeature = {"sve", "true"}, + counts = {IRNode.VFNMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public float[] vectorNegateMulAdd1() { @@ -217,6 +219,8 @@ public float[] vectorNegateMulAdd1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, counts = {IRNode.FMA_V, ">0"}) + @IR(applyIfCPUFeature = {"sve", "true"}, + counts = {IRNode.VFNMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, counts = {IRNode.FMA_V, ">0"}) public float[] vectorNegateMulAdd2() { From b7dee213dfb2d0ec4e22837898bf4837c1fe523d Mon Sep 17 00:00:00 2001 From: David Holmes Date: Tue, 15 Aug 2023 04:29:25 +0000 Subject: [PATCH 051/162] 8314244: Incorrect file headers in new tests from JDK-8312597 Reviewed-by: lmesnik, kvn --- test/hotspot/jtreg/compiler/arguments/TestLogJIT.java | 9 +++++---- .../jtreg/compiler/arguments/TestTraceTypeProfile.java | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/test/hotspot/jtreg/compiler/arguments/TestLogJIT.java b/test/hotspot/jtreg/compiler/arguments/TestLogJIT.java index 5974419a4c2..afafe17523c 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestLogJIT.java +++ b/test/hotspot/jtreg/compiler/arguments/TestLogJIT.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Amazon designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -17,6 +15,10 @@ * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ /* @@ -33,4 +35,3 @@ static public void main(String[] args) { System.out.println("Passed"); } } - diff --git a/test/hotspot/jtreg/compiler/arguments/TestTraceTypeProfile.java b/test/hotspot/jtreg/compiler/arguments/TestTraceTypeProfile.java index f2797b329f1..df1c253b689 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestTraceTypeProfile.java +++ b/test/hotspot/jtreg/compiler/arguments/TestTraceTypeProfile.java @@ -4,9 +4,7 @@ * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Amazon designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -17,6 +15,10 @@ * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ /* @@ -34,4 +36,3 @@ static public void main(String[] args) { System.out.println("Passed"); } } - From 6338927221ee82a556b55ccf79239acb2ac9729a Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 15 Aug 2023 07:48:38 +0000 Subject: [PATCH 052/162] 8314197: AttachListener::pd_find_operation always returning nullptr Reviewed-by: dholmes, cjplummer, sspitsyn --- src/hotspot/os/aix/attachListener_aix.cpp | 4 ---- src/hotspot/os/bsd/attachListener_bsd.cpp | 4 ---- src/hotspot/os/linux/attachListener_linux.cpp | 4 ---- src/hotspot/os/windows/attachListener_windows.cpp | 4 ---- src/hotspot/share/services/attachListener.cpp | 5 ----- src/hotspot/share/services/attachListener.hpp | 3 --- 6 files changed, 24 deletions(-) diff --git a/src/hotspot/os/aix/attachListener_aix.cpp b/src/hotspot/os/aix/attachListener_aix.cpp index 02bf4727194..169e719668c 100644 --- a/src/hotspot/os/aix/attachListener_aix.cpp +++ b/src/hotspot/os/aix/attachListener_aix.cpp @@ -579,10 +579,6 @@ void AttachListener::pd_data_dump() { os::signal_notify(SIGQUIT); } -AttachOperationFunctionInfo* AttachListener::pd_find_operation(const char* n) { - return nullptr; -} - jint AttachListener::pd_set_flag(AttachOperation* op, outputStream* out) { out->print_cr("flag '%s' cannot be changed", op->arg(0)); return JNI_ERR; diff --git a/src/hotspot/os/bsd/attachListener_bsd.cpp b/src/hotspot/os/bsd/attachListener_bsd.cpp index a790ed617c5..589656288de 100644 --- a/src/hotspot/os/bsd/attachListener_bsd.cpp +++ b/src/hotspot/os/bsd/attachListener_bsd.cpp @@ -542,10 +542,6 @@ void AttachListener::pd_data_dump() { os::signal_notify(SIGQUIT); } -AttachOperationFunctionInfo* AttachListener::pd_find_operation(const char* n) { - return nullptr; -} - jint AttachListener::pd_set_flag(AttachOperation* op, outputStream* out) { out->print_cr("flag '%s' cannot be changed", op->arg(0)); return JNI_ERR; diff --git a/src/hotspot/os/linux/attachListener_linux.cpp b/src/hotspot/os/linux/attachListener_linux.cpp index 63c5bfef125..26e34d2f3c3 100644 --- a/src/hotspot/os/linux/attachListener_linux.cpp +++ b/src/hotspot/os/linux/attachListener_linux.cpp @@ -547,10 +547,6 @@ void AttachListener::pd_data_dump() { os::signal_notify(SIGQUIT); } -AttachOperationFunctionInfo* AttachListener::pd_find_operation(const char* n) { - return nullptr; -} - jint AttachListener::pd_set_flag(AttachOperation* op, outputStream* out) { out->print_cr("flag '%s' cannot be changed", op->arg(0)); return JNI_ERR; diff --git a/src/hotspot/os/windows/attachListener_windows.cpp b/src/hotspot/os/windows/attachListener_windows.cpp index 8cd4d8d6715..d14ce2a848c 100644 --- a/src/hotspot/os/windows/attachListener_windows.cpp +++ b/src/hotspot/os/windows/attachListener_windows.cpp @@ -391,10 +391,6 @@ void AttachListener::pd_data_dump() { os::signal_notify(SIGBREAK); } -AttachOperationFunctionInfo* AttachListener::pd_find_operation(const char* n) { - return nullptr; -} - jint AttachListener::pd_set_flag(AttachOperation* op, outputStream* out) { out->print_cr("flag '%s' cannot be changed", op->arg(0)); return JNI_ERR; diff --git a/src/hotspot/share/services/attachListener.cpp b/src/hotspot/share/services/attachListener.cpp index a8f7256763a..ebbb2e10036 100644 --- a/src/hotspot/share/services/attachListener.cpp +++ b/src/hotspot/share/services/attachListener.cpp @@ -411,11 +411,6 @@ void AttachListenerThread::thread_entry(JavaThread* thread, TRAPS) { } } - // check for platform dependent attach operation - if (info == nullptr) { - info = AttachListener::pd_find_operation(op->name()); - } - if (info != nullptr) { // dispatch to the function that implements this operation res = (info->func)(op, &st); diff --git a/src/hotspot/share/services/attachListener.hpp b/src/hotspot/share/services/attachListener.hpp index 5cf32cc51ff..bef4087e2ea 100644 --- a/src/hotspot/share/services/attachListener.hpp +++ b/src/hotspot/share/services/attachListener.hpp @@ -121,9 +121,6 @@ class AttachListener: AllStatic { // platform specific initialization static int pd_init(); - // platform specific operation - static AttachOperationFunctionInfo* pd_find_operation(const char* name); - // platform specific flag change static jint pd_set_flag(AttachOperation* op, outputStream* out); From f4e72c58d7b188563a0413161419f91e024ec472 Mon Sep 17 00:00:00 2001 From: Dmitry Cherepanov Date: Tue, 15 Aug 2023 08:43:38 +0000 Subject: [PATCH 053/162] 8313949: Missing word in GPLv2 license text in StackMapTableAttribute.java Reviewed-by: iris --- .../classfile/attribute/StackMapTableAttribute.java | 6 +++--- .../jdk/internal/classfile/constantpool/ConstantPool.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/classfile/attribute/StackMapTableAttribute.java b/src/java.base/share/classes/jdk/internal/classfile/attribute/StackMapTableAttribute.java index fa9f3e2841c..6f7cc69b978 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/attribute/StackMapTableAttribute.java +++ b/src/java.base/share/classes/jdk/internal/classfile/attribute/StackMapTableAttribute.java @@ -3,18 +3,18 @@ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General License version 2 only, as + * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * - * You should have received a copy of the GNU General License version + * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * diff --git a/src/java.base/share/classes/jdk/internal/classfile/constantpool/ConstantPool.java b/src/java.base/share/classes/jdk/internal/classfile/constantpool/ConstantPool.java index 703b42a4cad..9c2ca4b9393 100644 --- a/src/java.base/share/classes/jdk/internal/classfile/constantpool/ConstantPool.java +++ b/src/java.base/share/classes/jdk/internal/classfile/constantpool/ConstantPool.java @@ -3,18 +3,18 @@ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General License version 2 only, as + * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * - * You should have received a copy of the GNU General License version + * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * From dff99f7f3d98372cb5bf8b1c2515b7628193cd2c Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 15 Aug 2023 09:09:02 +0000 Subject: [PATCH 054/162] 8313782: Add user-facing warning if THPs are enabled but cannot be used Reviewed-by: dholmes, sjohanss --- src/hotspot/os/linux/os_linux.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index a8fc37e709e..471afae0626 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -3793,15 +3793,17 @@ void os::large_page_init() { return; } - // 2) check if large pages are configured - if ( ( UseTransparentHugePages && HugePages::supports_thp() == false) || - (!UseTransparentHugePages && HugePages::supports_static_hugepages() == false) ) { - // No large pages configured, return. + // 2) check if the OS supports THPs resp. static hugepages. + if (UseTransparentHugePages && !HugePages::supports_thp()) { + if (!FLAG_IS_DEFAULT(UseTransparentHugePages)) { + log_warning(pagesize)("UseTransparentHugePages disabled, transparent huge pages are not supported by the operating system."); + } + UseLargePages = UseTransparentHugePages = UseHugeTLBFS = UseSHM = false; + return; + } + if (!UseTransparentHugePages && !HugePages::supports_static_hugepages()) { warn_no_large_pages_configured(); - UseLargePages = false; - UseTransparentHugePages = false; - UseHugeTLBFS = false; - UseSHM = false; + UseLargePages = UseTransparentHugePages = UseHugeTLBFS = UseSHM = false; return; } From a02d65efccaab5bb7c2f2aad4a2eb5062f545ef8 Mon Sep 17 00:00:00 2001 From: Emanuel Peter Date: Tue, 15 Aug 2023 10:08:51 +0000 Subject: [PATCH 055/162] 8310308: IR Framework: check for type and size of vector nodes Reviewed-by: chagedorn, thartmann --- .../jtreg/compiler/c2/TestMinMaxSubword.java | 8 +- .../irTests/TestAutoVecCountingDownLoop.java | 2 +- .../irTests/TestAutoVectorization2DArray.java | 9 +- .../irTests/TestDisableAutoVectOpcodes.java | 4 +- .../c2/irTests/TestVectorConditionalMove.java | 168 +- .../TestVectorizationMismatchedAccess.java | 29 +- .../irTests/TestVectorizationMultiInvar.java | 6 +- .../c2/irTests/TestVectorizationNotRun.java | 2 +- .../irTests/TestVectorizeTypeConversion.java | 21 +- .../irTests/TestVectorizeURShiftSubword.java | 12 +- .../compiler/lib/ir_framework/IRNode.java | 848 ++++- .../jtreg/compiler/lib/ir_framework/README.md | 20 + .../SuccessOnlyConstraintException.java | 35 + .../driver/irmatching/irmethod/IRMethod.java | 9 +- .../driver/irmatching/irrule/IRRule.java | 5 +- .../parsing/CheckAttributeReader.java | 34 +- .../checkattribute/parsing/RawIRNode.java | 81 +- .../irrule/constraint/Constraint.java | 6 + .../constraint/SuccessConstraintCheck.java | 41 + .../irrule/constraint/raw/RawConstraint.java | 3 +- .../constraint/raw/RawCountsConstraint.java | 49 +- .../constraint/raw/RawFailOnConstraint.java | 7 +- .../phase/CompilePhaseIRRuleBuilder.java | 22 +- .../DefaultPhaseRawConstraintParser.java | 15 +- .../irmatching/parser/IRMethodBuilder.java | 8 +- .../irmatching/parser/TestClassParser.java | 7 +- .../driver/irmatching/parser/VMInfo.java | 107 + .../irmatching/parser/VMInfoParser.java | 77 + .../lib/ir_framework/shared/Comparison.java | 6 + .../lib/ir_framework/test/TestVM.java | 1 + .../lib/ir_framework/test/VMInfoPrinter.java | 70 + .../superword/SumRedAbsNeg_Double.java | 2 +- .../superword/SumRedAbsNeg_Float.java | 6 +- .../loopopts/superword/SumRedSqrt_Double.java | 4 +- .../superword/TestCyclicDependency.java | 4 +- .../superword/TestDependencyOffsets.java | 2762 ++++++++--------- ...tIndependentPacksWithCyclicDependency.java | 2 +- .../superword/TestUnorderedReduction.java | 6 +- ...norderedReductionPartialVectorization.java | 7 +- .../vectorapi/TestMaskedMacroLogicVector.java | 12 +- .../vectorapi/TestReverseByteTransforms.java | 18 +- .../TestReverseByteTransformsSVE.java | 6 +- .../TestVectorCompressExpandBits.java | 8 +- .../vectorapi/VectorFPtoIntCastTest.java | 24 +- .../VectorLogicalOpIdentityTest.java | 82 +- .../vectorapi/VectorReverseBytesTest.java | 6 +- .../reshape/tests/TestVectorCast.java | 289 +- .../reshape/utils/VectorReshapeHelper.java | 9 - .../vectorization/TestAutoVecIntMinMax.java | 16 +- .../TestFloatConversionsVector.java | 4 +- .../vectorization/TestOptionVectorizeIR.java | 32 +- .../vectorization/TestReverseBitsVector.java | 12 +- .../vectorization/TestReverseBytes.java | 8 +- .../TestSubwordReverseBytes.java | 4 +- .../runner/ArrayShiftOpTest.java | 14 +- .../runner/ArrayTypeConvertTest.java | 32 +- .../runner/BasicBooleanOpTest.java | 10 +- .../vectorization/runner/BasicByteOpTest.java | 32 +- .../vectorization/runner/BasicCharOpTest.java | 31 +- .../runner/BasicDoubleOpTest.java | 42 +- .../runner/BasicFloatOpTest.java | 42 +- .../vectorization/runner/BasicIntOpTest.java | 28 +- .../vectorization/runner/BasicLongOpTest.java | 30 +- .../runner/BasicShortOpTest.java | 30 +- .../runner/LoopArrayIndexComputeTest.java | 12 +- .../runner/LoopReductionOpTest.java | 10 +- .../ir_framework/examples/IRExample.java | 128 + .../ir_framework/tests/TestBadFormat.java | 56 +- .../ir_framework/tests/TestIRMatching.java | 25 +- .../tests/TestSafepointWhilePrinting.java | 9 + 70 files changed, 3498 insertions(+), 2068 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/driver/SuccessOnlyConstraintException.java create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/SuccessConstraintCheck.java create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfo.java create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfoParser.java create mode 100644 test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java diff --git a/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java b/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java index 129fdc7096a..955aa4058f0 100644 --- a/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java +++ b/test/hotspot/jtreg/compiler/c2/TestMinMaxSubword.java @@ -61,7 +61,7 @@ public class TestMinMaxSubword { // as Java APIs for Math.min/max do not support integer subword types and superword // should not generate vectorized Min/Max nodes for them. @Test - @IR(failOn = {IRNode.MIN_V}) + @IR(failOn = {IRNode.MIN_VI, IRNode.MIN_VF, IRNode.MIN_VD}) public static void testMinShort() { for (int i = 0; i < LENGTH; i++) { sb[i] = (short) Math.min(sa[i], val); @@ -77,7 +77,7 @@ public static void testMinShort_runner() { } @Test - @IR(failOn = {IRNode.MAX_V}) + @IR(failOn = {IRNode.MAX_VI, IRNode.MAX_VF, IRNode.MAX_VD}) public static void testMaxShort() { for (int i = 0; i < LENGTH; i++) { sb[i] = (short) Math.max(sa[i], val); @@ -92,7 +92,7 @@ public static void testMaxShort_runner() { } @Test - @IR(failOn = {IRNode.MIN_V}) + @IR(failOn = {IRNode.MIN_VI, IRNode.MIN_VF, IRNode.MIN_VD}) public static void testMinByte() { for (int i = 0; i < LENGTH; i++) { bb[i] = (byte) Math.min(ba[i], val); @@ -108,7 +108,7 @@ public static void testMinByte_runner() { } @Test - @IR(failOn = {IRNode.MAX_V}) + @IR(failOn = {IRNode.MAX_VI, IRNode.MAX_VF, IRNode.MAX_VD}) public static void testMaxByte() { for (int i = 0; i < LENGTH; i++) { bb[i] = (byte) Math.max(ba[i], val); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVecCountingDownLoop.java b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVecCountingDownLoop.java index 9769f8d43a7..994ec1e9cc0 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVecCountingDownLoop.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVecCountingDownLoop.java @@ -46,7 +46,7 @@ public static void main(String[] args) { @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testCountingDown(int[] a, int[] b) { for (int i = 2000; i > 0; i--) { diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java index 31fc5361b6b..c9b2904d91c 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestAutoVectorization2DArray.java @@ -48,9 +48,12 @@ public static void main(String[] args) { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, " >0 " }) - @IR(counts = { IRNode.ADD_VD, " >0 " }) - @IR(counts = { IRNode.STORE_VECTOR, " >0 " }) + // Given small iteration count, the unrolling factor is not very predictable, + // hence it is difficult to exactly predict the vector size. But let's at least + // check that there is some vectorization of any size. + @IR(counts = { IRNode.LOAD_VECTOR_D, IRNode.VECTOR_SIZE_ANY, " >0 " }) + @IR(counts = { IRNode.ADD_VD, IRNode.VECTOR_SIZE_ANY, " >0 " }) + @IR(counts = { IRNode.STORE_VECTOR, " >0 " }) private static void testDouble(double[][] a , double[][] b, double[][] c) { for(int i = 0; i < a.length; i++) { for (int j = 0; j < a[0].length; j++) { diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestDisableAutoVectOpcodes.java b/test/hotspot/jtreg/compiler/c2/irTests/TestDisableAutoVectOpcodes.java index f493b3fc307..31112a74eb1 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestDisableAutoVectOpcodes.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestDisableAutoVectOpcodes.java @@ -53,7 +53,7 @@ public static void main(String[] args) { } @Test - @IR(failOn = {IRNode.VECTOR_CAST_D2X}) + @IR(failOn = {IRNode.VECTOR_CAST_D2I}) private static void testConvD2I() { for(int i = 0; i < SIZE; i++) { inta[i] = (int) (doublea[i]); @@ -61,7 +61,7 @@ private static void testConvD2I() { } @Test - @IR(failOn = {IRNode.VECTOR_CAST_L2X}) + @IR(failOn = {IRNode.VECTOR_CAST_L2F}) private static void testConvL2F() { for(int i = 0; i < SIZE; i++) { floata[i] = (float) (longa[i]); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java index 6cd87f19339..f50b091719e 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java @@ -203,7 +203,10 @@ private double cmoveDGTforD(double a, double b, double c, double d) { // Compare 2 values, and pick one of them @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFGT(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -212,7 +215,10 @@ private static void testCMoveVFGT(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFGTSwap(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -221,7 +227,10 @@ private static void testCMoveVFGTSwap(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFLT(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -230,7 +239,10 @@ private static void testCMoveVFLT(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFLTSwap(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -239,7 +251,10 @@ private static void testCMoveVFLTSwap(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVFEQ(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -248,7 +263,10 @@ private static void testCMoveVFEQ(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDLE(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -257,7 +275,10 @@ private static void testCMoveVDLE(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDLESwap(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -266,7 +287,10 @@ private static void testCMoveVDLESwap(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDGE(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -275,7 +299,10 @@ private static void testCMoveVDGE(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDGESwap(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -284,7 +311,10 @@ private static void testCMoveVDGESwap(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveVDNE(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -294,7 +324,10 @@ private static void testCMoveVDNE(double[] a, double[] b, double[] c) { // Extensions: compare 2 values, and pick from 2 consts @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGTforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -303,7 +336,10 @@ private static void testCMoveFGTforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGEforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -312,7 +348,10 @@ private static void testCMoveFGEforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFLTforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -321,7 +360,10 @@ private static void testCMoveFLTforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFLEforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -330,7 +372,10 @@ private static void testCMoveFLEforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFEQforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -339,7 +384,10 @@ private static void testCMoveFEQforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFNEQforFConst(float[] a, float[] b, float[] c) { for (int i = 0; i < a.length; i++) { @@ -348,7 +396,10 @@ private static void testCMoveFNEQforFConst(float[] a, float[] b, float[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDGTforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -357,7 +408,10 @@ private static void testCMoveDGTforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDGEforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -366,7 +420,10 @@ private static void testCMoveDGEforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDLTforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -375,7 +432,10 @@ private static void testCMoveDLTforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDLEforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -384,7 +444,10 @@ private static void testCMoveDLEforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDEQforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -393,7 +456,10 @@ private static void testCMoveDEQforDConst(double[] a, double[] b, double[] c) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDNEQforDConst(double[] a, double[] b, double[] c) { for (int i = 0; i < a.length; i++) { @@ -408,7 +474,7 @@ private static void testCMoveDNEQforDConst(double[] a, double[] b, double[] c) { // compilation does not know that). // So far, vectorization only works for CMoveF/D, with same data-width comparison (F/I for F, D/L for D). @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveIGTforI(int[] a, int[] b, int[] c, int[] d, int[] r, int[] r2) { for (int i = 0; i < a.length; i++) { int cc = c[i]; @@ -419,7 +485,7 @@ private static void testCMoveIGTforI(int[] a, int[] b, int[] c, int[] d, int[] r } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveIGTforL(int[] a, int[] b, long[] c, long[] d, long[] r, long[] r2) { for (int i = 0; i < a.length; i++) { long cc = c[i]; @@ -430,7 +496,11 @@ private static void testCMoveIGTforL(int[] a, int[] b, long[] c, long[] d, long[ } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0", + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0", + IRNode.VECTOR_MASK_CMP_I, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0", + IRNode.VECTOR_BLEND_F, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveIGTforF(int[] a, int[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { @@ -442,7 +512,7 @@ private static void testCMoveIGTforF(int[] a, int[] b, float[] c, float[] d, flo } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveIGTforD(int[] a, int[] b, double[] c, double[] d, double[] r, double[] r2) { for (int i = 0; i < a.length; i++) { double cc = c[i]; @@ -453,7 +523,7 @@ private static void testCMoveIGTforD(int[] a, int[] b, double[] c, double[] d, d } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveLGTforI(long[] a, long[] b, int[] c, int[] d, int[] r, int[] r2) { for (int i = 0; i < a.length; i++) { int cc = c[i]; @@ -464,7 +534,7 @@ private static void testCMoveLGTforI(long[] a, long[] b, int[] c, int[] d, int[] } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveLGTforL(long[] a, long[] b, long[] c, long[] d, long[] r, long[] r2) { for (int i = 0; i < a.length; i++) { long cc = c[i]; @@ -475,7 +545,7 @@ private static void testCMoveLGTforL(long[] a, long[] b, long[] c, long[] d, lon } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveLGTforF(long[] a, long[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { float cc = c[i]; @@ -486,7 +556,11 @@ private static void testCMoveLGTforF(long[] a, long[] b, float[] c, float[] d, f } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0", + IRNode.LOAD_VECTOR_D, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0", + IRNode.VECTOR_MASK_CMP_L, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0", + IRNode.VECTOR_BLEND_D, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx2", "true", "asimd", "true"}) // Requires avx2, else L is restricted to 16 byte, and D has 32. That leads to a vector elements mismatch of 2 to 4. private static void testCMoveLGTforD(long[] a, long[] b, double[] c, double[] d, double[] r, double[] r2) { @@ -499,7 +573,7 @@ private static void testCMoveLGTforD(long[] a, long[] b, double[] c, double[] d, } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveFGTforI(float[] a, float[] b, int[] c, int[] d, int[] r, int[] r2) { for (int i = 0; i < a.length; i++) { int cc = c[i]; @@ -510,7 +584,7 @@ private static void testCMoveFGTforI(float[] a, float[] b, int[] c, int[] d, int } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveFGTforL(float[] a, float[] b, long[] c, long[] d, long[] r, long[] r2) { for (int i = 0; i < a.length; i++) { long cc = c[i]; @@ -521,7 +595,10 @@ private static void testCMoveFGTforL(float[] a, float[] b, long[] c, long[] d, l } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGTforF(float[] a, float[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { @@ -533,7 +610,7 @@ private static void testCMoveFGTforF(float[] a, float[] b, float[] c, float[] d, } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveFGTforD(float[] a, float[] b, double[] c, double[] d, double[] r, double[] r2) { for (int i = 0; i < a.length; i++) { double cc = c[i]; @@ -544,7 +621,7 @@ private static void testCMoveFGTforD(float[] a, float[] b, double[] c, double[] } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveDGTforI(double[] a, double[] b, int[] c, int[] d, int[] r, int[] r2) { for (int i = 0; i < a.length; i++) { int cc = c[i]; @@ -555,7 +632,7 @@ private static void testCMoveDGTforI(double[] a, double[] b, int[] c, int[] d, i } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveDGTforL(double[] a, double[] b, long[] c, long[] d, long[] r, long[] r2) { for (int i = 0; i < a.length; i++) { long cc = c[i]; @@ -566,7 +643,7 @@ private static void testCMoveDGTforL(double[] a, double[] b, long[] c, long[] d, } @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveDGTforF(double[] a, double[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { float cc = c[i]; @@ -577,7 +654,10 @@ private static void testCMoveDGTforF(double[] a, double[] b, float[] c, float[] } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveDGTforD(double[] a, double[] b, double[] c, double[] d, double[] r, double[] r2) { for (int i = 0; i < a.length; i++) { @@ -590,7 +670,10 @@ private static void testCMoveDGTforD(double[] a, double[] b, double[] c, double[ // Use some constants in the comparison @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGTforFCmpCon1(float a, float[] b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < b.length; i++) { @@ -602,7 +685,10 @@ private static void testCMoveFGTforFCmpCon1(float a, float[] b, float[] c, float } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.VECTOR_MASK_CMP, ">0", IRNode.VECTOR_BLEND, ">0", IRNode.STORE_VECTOR, ">0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) private static void testCMoveFGTforFCmpCon2(float[] a, float b, float[] c, float[] d, float[] r, float[] r2) { for (int i = 0; i < a.length; i++) { @@ -615,7 +701,7 @@ private static void testCMoveFGTforFCmpCon2(float[] a, float b, float[] c, float // A case that is currently not supported and is not expected to vectorize @Test - @IR(failOn = {IRNode.VECTOR_MASK_CMP, IRNode.VECTOR_BLEND}) + @IR(failOn = {IRNode.STORE_VECTOR}) private static void testCMoveVDUnsupported() { double[] doublec = new double[SIZE]; int seed = 1001; diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java index 0e9e48160b5..3b7bf231730 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java @@ -150,7 +150,7 @@ static private void runAndVerify3(Runnable test, int offset) { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong1(byte[] dest, long[] src) { for (int i = 0; i < src.length; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i, src[i]); @@ -163,7 +163,7 @@ public static void testByteLong1_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong2(byte[] dest, long[] src) { for (int i = 1; i < src.length; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i - 1), src[i]); @@ -176,7 +176,7 @@ public static void testByteLong2_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong3(byte[] dest, long[] src) { for (int i = 0; i < src.length - 1; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + 1), src[i]); @@ -189,7 +189,7 @@ public static void testByteLong3_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong4(byte[] dest, long[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(dest, 8 * i + baseOffset, src[i]); @@ -203,7 +203,7 @@ public static void testByteLong4_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong5(byte[] dest, long[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + baseOffset), src[i]); @@ -217,7 +217,7 @@ public static void testByteLong5_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteByte1(byte[] dest, byte[] src) { for (int i = 0; i < src.length / 8; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i, UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -229,9 +229,8 @@ public static void testByteByte1_runner() { runAndVerify2(() -> testByteByte1(byteArray, byteArray), 0); } - // It would be legal to vectorize this one but it's not currently @Test - //@IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteByte2(byte[] dest, byte[] src) { for (int i = 1; i < src.length / 8; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i - 1), UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -244,7 +243,7 @@ public static void testByteByte2_runner() { } @Test - @IR(failOn = { IRNode.LOAD_VECTOR, IRNode.STORE_VECTOR }) + @IR(failOn = { IRNode.LOAD_VECTOR_L, IRNode.STORE_VECTOR }) public static void testByteByte3(byte[] dest, byte[] src) { for (int i = 0; i < src.length / 8 - 1; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + 1), UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -257,7 +256,7 @@ public static void testByteByte3_runner() { } @Test - @IR(failOn = { IRNode.LOAD_VECTOR, IRNode.STORE_VECTOR }) + @IR(failOn = { IRNode.LOAD_VECTOR_L, IRNode.STORE_VECTOR }) public static void testByteByte4(byte[] dest, byte[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(dest, 8 * i + baseOffset, UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -271,7 +270,7 @@ public static void testByteByte4_runner() { } @Test - @IR(failOn = { IRNode.LOAD_VECTOR, IRNode.STORE_VECTOR }) + @IR(failOn = { IRNode.LOAD_VECTOR_L, IRNode.STORE_VECTOR }) public static void testByteByte5(byte[] dest, byte[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * (i + baseOffset), UNSAFE.getLongUnaligned(src, UNSAFE.ARRAY_BYTE_BASE_OFFSET + 8 * i)); @@ -285,7 +284,7 @@ public static void testByteByte5_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testOffHeapLong1(long dest, long[] src) { for (int i = 0; i < src.length; i++) { UNSAFE.putLongUnaligned(null, dest + 8 * i, src[i]); @@ -298,7 +297,7 @@ public static void testOffHeapLong1_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testOffHeapLong2(long dest, long[] src) { for (int i = 1; i < src.length; i++) { UNSAFE.putLongUnaligned(null, dest + 8 * (i - 1), src[i]); @@ -311,7 +310,7 @@ public static void testOffHeapLong2_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testOffHeapLong3(long dest, long[] src) { for (int i = 0; i < src.length - 1; i++) { UNSAFE.putLongUnaligned(null, dest + 8 * (i + 1), src[i]); @@ -324,7 +323,7 @@ public static void testOffHeapLong3_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testOffHeapLong4(long dest, long[] src, int start, int stop) { for (int i = start; i < stop; i++) { UNSAFE.putLongUnaligned(null, dest + 8 * i + baseOffset, src[i]); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMultiInvar.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMultiInvar.java index 6b5c886cf86..72276254ab2 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMultiInvar.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMultiInvar.java @@ -60,7 +60,7 @@ public static void main(String[] args) { static long baseOffset = 0; @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testByteLong1(byte[] dest, long[] src) { for (int i = 0; i < src.length; i++) { long j = Objects.checkIndex(i * 8, (long)(src.length * 8)); @@ -75,7 +75,7 @@ public static void testByteLong1_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_B, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testLoopNest1(byte[] dest, byte[] src, long start1, long stop1, long start2, long stop2, @@ -106,7 +106,7 @@ public static void testLoopNest1_runner() { } @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_I, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void testLoopNest2(int[] dest, int[] src, long start1, long stop1, long start2, long stop2, diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java index 26a4550c5c8..5968b7221c7 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationNotRun.java @@ -51,7 +51,7 @@ public static void main(String[] args) { static long[] longArray = new long[size]; @Test - @IR(counts = { IRNode.LOAD_VECTOR, ">=1", IRNode.STORE_VECTOR, ">=1" }) + @IR(counts = { IRNode.LOAD_VECTOR_L, ">=1", IRNode.STORE_VECTOR, ">=1" }) public static void test(byte[] dest, long[] src) { for (int i = 0; i < src.length; i++) { if ((i < 0) || (8 > sizeBytes - i)) { diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeTypeConversion.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeTypeConversion.java index 9255bf4aeee..67c26ecbddf 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeTypeConversion.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeTypeConversion.java @@ -55,8 +55,9 @@ public static void main(String[] args) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", - IRNode.VECTOR_CAST_I2X, ">0", + // Mixing types of different sizes has the effect that some vectors are shorter than the type allows. + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_double)", ">0", + IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE + "min(max_int, max_double)", ">0", IRNode.STORE_VECTOR, ">0"}, // The vectorization of some conversions may fail when `+AlignVector`. // We can remove the condition after JDK-8303827. @@ -68,9 +69,11 @@ private static void testConvI2D(double[] d, int[] a) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", - IRNode.VECTOR_CAST_I2X, ">0", - IRNode.VECTOR_CAST_L2X, ">0", + // Mixing types of different sizes has the effect that some vectors are shorter than the type allows. + @IR(counts = {IRNode.LOAD_VECTOR_L, IRNode.VECTOR_SIZE + "min(max_int, max_long)", ">0", + IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_long)", ">0", + IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE + "min(max_int, max_long)", ">0", + IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE + "min(max_int, max_long)", ">0", IRNode.STORE_VECTOR, ">0"}) private static void testConvI2L(int[] d1, int d2[], long[] a1, long[] a2) { for(int i = 0; i < d1.length; i++) { @@ -80,9 +83,11 @@ private static void testConvI2L(int[] d1, int d2[], long[] a1, long[] a2) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", - IRNode.VECTOR_CAST_D2X, ">0", - IRNode.VECTOR_CAST_F2X, ">0", + // Mixing types of different sizes has the effect that some vectors are shorter than the type allows. + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0", + IRNode.LOAD_VECTOR_D, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0", + IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0", + IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0", IRNode.STORE_VECTOR, ">0"}) private static void testConvF2D(double[] d1, double[] d2, float[] a1, float[] a2) { for(int i = 0; i < d1.length; i++) { diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeURShiftSubword.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeURShiftSubword.java index 187e05855ff..ebe3fe63ccf 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeURShiftSubword.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeURShiftSubword.java @@ -70,7 +70,7 @@ public static void main(String[] args) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.RSHIFT_VB, ">0", IRNode.STORE_VECTOR, ">0"}) + @IR(counts = {IRNode.LOAD_VECTOR_B, ">0", IRNode.RSHIFT_VB, ">0", IRNode.STORE_VECTOR, ">0"}) public void testByte0() { for(int i = 0; i < NUM; i++) { byteb[i] = (byte) (bytea[i] >>> 3); @@ -78,7 +78,7 @@ public void testByte0() { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.RSHIFT_VB, ">0", IRNode.STORE_VECTOR, ">0"}) + @IR(counts = {IRNode.LOAD_VECTOR_B, ">0", IRNode.RSHIFT_VB, ">0", IRNode.STORE_VECTOR, ">0"}) public void testByte1() { for(int i = 0; i < NUM; i++) { byteb[i] = (byte) (bytea[i] >>> 24); @@ -86,7 +86,7 @@ public void testByte1() { } @Test - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.RSHIFT_VB, IRNode.STORE_VECTOR}) + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.RSHIFT_VB, IRNode.STORE_VECTOR}) public void testByte2() { for(int i = 0; i < NUM; i++) { byteb[i] = (byte) (bytea[i] >>> 25); @@ -94,7 +94,7 @@ public void testByte2() { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.RSHIFT_VS, ">0", IRNode.STORE_VECTOR, ">0"}) + @IR(counts = {IRNode.LOAD_VECTOR_S, ">0", IRNode.RSHIFT_VS, ">0", IRNode.STORE_VECTOR, ">0"}) public void testShort0() { for(int i = 0; i < NUM; i++) { shortb[i] = (short) (shorta[i] >>> 10); @@ -102,7 +102,7 @@ public void testShort0() { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, ">0", IRNode.RSHIFT_VS, ">0", IRNode.STORE_VECTOR, ">0"}) + @IR(counts = {IRNode.LOAD_VECTOR_S, ">0", IRNode.RSHIFT_VS, ">0", IRNode.STORE_VECTOR, ">0"}) public void testShort1() { for(int i = 0; i < NUM; i++) { shortb[i] = (short) (shorta[i] >>> 16); @@ -110,7 +110,7 @@ public void testShort1() { } @Test - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.RSHIFT_VS, IRNode.STORE_VECTOR}) + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.RSHIFT_VS, IRNode.STORE_VECTOR}) public void testShort2() { for(int i = 0; i < NUM; i++) { shortb[i] = (short) (shorta[i] >>> 17); diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index cbd95fcac24..3e2db1541dd 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -24,6 +24,7 @@ package compiler.lib.ir_framework; import compiler.lib.ir_framework.driver.irmatching.mapping.*; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; import compiler.lib.ir_framework.shared.CheckedTestFrameworkException; import compiler.lib.ir_framework.shared.TestFormat; import compiler.lib.ir_framework.shared.TestFormatException; @@ -69,6 +70,17 @@ * Using this IR node expects another user provided string in the constraint list of * {@link IR#failOn()} and {@link IR#counts()}. They cannot be used as normal IR nodes. * Trying to do so will result in a format violation error. + *
  • Vector IR nodes: The IR node placeholder string contains an additional {@link #VECTOR_PREFIX}. + * Using this IR node, one can check for the type and size of a vector. The type must + * be directly specified in {@link #vectorNode}. The size can be specified directly with + * an additional argument using {@link #VECTOR_SIZE}, followed by a size tag or a comma + * separated list of sizes. If the size argument is not given, then a default size of + * {@link #VECTOR_SIZE_MAX} is taken, which is the number of elements that can fit in a + * vector of the specified type (depends on the VM flag MaxVectorSize and CPU features). + * However, when using {@link IR#failOn} or {@link IR#counts()} with comparison {@code <}, + * or {@code <=} or {@code =0}, the default size is {@link #VECTOR_SIZE_ANY}, allowing any + * size. The motivation for these default values is that in most cases one wants to have + * vectorization with maximal vector width, or no vectorization of any vector width. * */ public class IRNode { @@ -80,6 +92,11 @@ public class IRNode { * Prefix for composite IR nodes. */ private static final String COMPOSITE_PREFIX = PREFIX + "C#"; + /** + * Prefix for vector IR nodes. + */ + private static final String VECTOR_PREFIX = PREFIX + "V#"; + private static final String POSTFIX = "#_"; private static final String START = "(\\d+(\\s){2}("; @@ -90,20 +107,44 @@ public class IRNode { public static final String IS_REPLACED = "#IS_REPLACED#"; // Is replaced by an additional user-defined string. + public static final String VECTOR_SIZE = "_@"; + public static final String VECTOR_SIZE_TAG_ANY = "any"; + public static final String VECTOR_SIZE_TAG_MAX = "max_for_type"; + public static final String VECTOR_SIZE_ANY = VECTOR_SIZE + VECTOR_SIZE_TAG_ANY; // default for counts "=0" and failOn + public static final String VECTOR_SIZE_MAX = VECTOR_SIZE + VECTOR_SIZE_TAG_MAX; // default in counts + public static final String VECTOR_SIZE_2 = VECTOR_SIZE + "2"; + public static final String VECTOR_SIZE_4 = VECTOR_SIZE + "4"; + public static final String VECTOR_SIZE_8 = VECTOR_SIZE + "8"; + public static final String VECTOR_SIZE_16 = VECTOR_SIZE + "16"; + public static final String VECTOR_SIZE_32 = VECTOR_SIZE + "32"; + public static final String VECTOR_SIZE_64 = VECTOR_SIZE + "64"; + + private static final String TYPE_BYTE = "byte"; + private static final String TYPE_CHAR = "char"; + private static final String TYPE_SHORT = "short"; + private static final String TYPE_INT = "int"; + private static final String TYPE_LONG = "long"; + private static final String TYPE_FLOAT = "float"; + private static final String TYPE_DOUBLE = "double"; /** * IR placeholder string to regex-for-compile-phase map. */ private static final Map IR_NODE_MAPPINGS = new HashMap<>(); + /** + * Map every vectorNode to a type string. + */ + private static final Map VECTOR_NODE_TYPE = new HashMap<>(); + /* * Start of IR placeholder string definitions followed by a static block defining the regex-for-compile-phase mapping. * An IR node placeholder string must start with PREFIX for normal IR nodes or COMPOSITE_PREFIX for composite IR - * nodes (see class description above). + * nodes, or VECTOR_PREFIX for vector nodes (see class description above). * * An IR node definition looks like this: * - * public static final String IR_NODE = [PREFIX|COMPOSITE_PREFIX] + "IR_NODE" + POSTFIX; + * public static final String IR_NODE = [PREFIX|COMPOSITE_PREFIX|VECTOR_PREFIX] + "IR_NODE" + POSTFIX; * static { * // Define IR_NODE to regex-for-compile-phase mapping. Create a new IRNodeMapEntry object and add it to * // IR_NODE_MAPPINGS. This can be done by using the helper methods defined after all IR node placeholder string @@ -131,9 +172,36 @@ public class IRNode { beforeMatchingNameRegex(ABS_L, "AbsL"); } - public static final String ABS_V = PREFIX + "ABS_V" + POSTFIX; + public static final String ABS_VB = VECTOR_PREFIX + "ABS_VB" + POSTFIX; + static { + vectorNode(ABS_VB, "AbsVB", TYPE_BYTE); + } + + // ABS_VC / AbsVC does not exist (char is 2 byte unsigned) + + public static final String ABS_VS = VECTOR_PREFIX + "ABS_VS" + POSTFIX; + static { + vectorNode(ABS_VS, "AbsVS", TYPE_SHORT); + } + + public static final String ABS_VI = VECTOR_PREFIX + "ABS_VI" + POSTFIX; + static { + vectorNode(ABS_VI, "AbsVI", TYPE_INT); + } + + public static final String ABS_VL = VECTOR_PREFIX + "ABS_VL" + POSTFIX; + static { + vectorNode(ABS_VL, "AbsVL", TYPE_LONG); + } + + public static final String ABS_VF = VECTOR_PREFIX + "ABS_VF" + POSTFIX; + static { + vectorNode(ABS_VF, "AbsVF", TYPE_FLOAT); + } + + public static final String ABS_VD = VECTOR_PREFIX + "ABS_VD" + POSTFIX; static { - beforeMatchingNameRegex(ABS_V, "AbsV(B|S|I|L|F|D)"); + vectorNode(ABS_VD, "AbsVD", TYPE_DOUBLE); } public static final String ADD = PREFIX + "ADD" + POSTFIX; @@ -151,24 +219,34 @@ public class IRNode { beforeMatchingNameRegex(ADD_L, "AddL"); } - public static final String ADD_V = PREFIX + "ADD_V" + POSTFIX; + public static final String ADD_VD = VECTOR_PREFIX + "ADD_VD" + POSTFIX; + static { + vectorNode(ADD_VD, "AddVD", TYPE_DOUBLE); + } + + public static final String ADD_VI = VECTOR_PREFIX + "ADD_VI" + POSTFIX; static { - beforeMatchingNameRegex(ADD_V, "AddV(B|S|I|L|F|D)"); + vectorNode(ADD_VI, "AddVI", TYPE_INT); } - public static final String ADD_VD = PREFIX + "ADD_VD" + POSTFIX; + public static final String ADD_VF = VECTOR_PREFIX + "ADD_VF" + POSTFIX; static { - beforeMatchingNameRegex(ADD_VD, "AddVD"); + vectorNode(ADD_VF, "AddVF", TYPE_FLOAT); } - public static final String ADD_VI = PREFIX + "ADD_VI" + POSTFIX; + public static final String ADD_VB = VECTOR_PREFIX + "ADD_VB" + POSTFIX; static { - beforeMatchingNameRegex(ADD_VI, "AddVI"); + vectorNode(ADD_VB, "AddVB", TYPE_BYTE); } - public static final String ADD_VF = PREFIX + "ADD_VF" + POSTFIX; + public static final String ADD_VS = VECTOR_PREFIX + "ADD_VS" + POSTFIX; static { - beforeMatchingNameRegex(ADD_VF, "AddVF"); + vectorNode(ADD_VS, "AddVS", TYPE_SHORT); + } + + public static final String ADD_VL = VECTOR_PREFIX + "ADD_VL" + POSTFIX; + static { + vectorNode(ADD_VL, "AddVL", TYPE_LONG); } public static final String ADD_REDUCTION_V = PREFIX + "ADD_REDUCTION_V" + POSTFIX; @@ -235,9 +313,29 @@ public class IRNode { beforeMatchingNameRegex(AND_L, "AndL"); } - public static final String AND_V = PREFIX + "AND_V" + POSTFIX; + public static final String AND_VB = VECTOR_PREFIX + "AND_VB" + POSTFIX; + static { + vectorNode(AND_VB, "AndV", TYPE_BYTE); + } + + public static final String AND_VC = VECTOR_PREFIX + "AND_VC" + POSTFIX; + static { + vectorNode(AND_VC, "AndV", TYPE_CHAR); + } + + public static final String AND_VS = VECTOR_PREFIX + "AND_VS" + POSTFIX; + static { + vectorNode(AND_VS, "AndV", TYPE_SHORT); + } + + public static final String AND_VI = VECTOR_PREFIX + "AND_VI" + POSTFIX; + static { + vectorNode(AND_VI, "AndV", TYPE_INT); + } + + public static final String AND_VL = VECTOR_PREFIX + "AND_VL" + POSTFIX; static { - beforeMatchingNameRegex(AND_V, "AndV"); + vectorNode(AND_VL, "AndV", TYPE_LONG); } public static final String AND_V_MASK = PREFIX + "AND_V_MASK" + POSTFIX; @@ -386,9 +484,14 @@ public class IRNode { beforeMatchingNameRegex(DIV_L, "DivL"); } - public static final String DIV_V = PREFIX + "DIV_V" + POSTFIX; + public static final String DIV_VF = VECTOR_PREFIX + "DIV_VF" + POSTFIX; static { - beforeMatchingNameRegex(DIV_V, "DivV(F|D)"); + vectorNode(DIV_VF, "DivVF", TYPE_FLOAT); + } + + public static final String DIV_VD = VECTOR_PREFIX + "DIV_VD" + POSTFIX; + static { + vectorNode(DIV_VD, "DivVD", TYPE_DOUBLE); } public static final String DYNAMIC_CALL_OF_METHOD = COMPOSITE_PREFIX + "DYNAMIC_CALL_OF_METHOD" + POSTFIX; @@ -418,9 +521,14 @@ public class IRNode { optoOnly(FIELD_ACCESS, regex); } - public static final String FMA_V = PREFIX + "FMA_V" + POSTFIX; + public static final String FMA_VF = VECTOR_PREFIX + "FMA_VF" + POSTFIX; + static { + vectorNode(FMA_VF, "FmaVF", TYPE_FLOAT); + } + + public static final String FMA_VD = VECTOR_PREFIX + "FMA_VD" + POSTFIX; static { - beforeMatchingNameRegex(FMA_V, "FmaV(F|D)"); + vectorNode(FMA_VD, "FmaVD", TYPE_DOUBLE); } public static final String IF = PREFIX + "IF" + POSTFIX; @@ -582,9 +690,39 @@ public class IRNode { loadOfNodes(LOAD_US_OF_CLASS, "LoadUS"); } - public static final String LOAD_VECTOR = PREFIX + "LOAD_VECTOR" + POSTFIX; + public static final String LOAD_VECTOR_B = VECTOR_PREFIX + "LOAD_VECTOR_B" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_B, "LoadVector", TYPE_BYTE); + } + + public static final String LOAD_VECTOR_C = VECTOR_PREFIX + "LOAD_VECTOR_C" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_C, "LoadVector", TYPE_CHAR); + } + + public static final String LOAD_VECTOR_S = VECTOR_PREFIX + "LOAD_VECTOR_S" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_S, "LoadVector", TYPE_SHORT); + } + + public static final String LOAD_VECTOR_I = VECTOR_PREFIX + "LOAD_VECTOR_I" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_I, "LoadVector", TYPE_INT); + } + + public static final String LOAD_VECTOR_L = VECTOR_PREFIX + "LOAD_VECTOR_L" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_L, "LoadVector", TYPE_LONG); + } + + public static final String LOAD_VECTOR_F = VECTOR_PREFIX + "LOAD_VECTOR_F" + POSTFIX; static { - beforeMatchingNameRegex(LOAD_VECTOR, "LoadVector"); + vectorNode(LOAD_VECTOR_F, "LoadVector", TYPE_FLOAT); + } + + public static final String LOAD_VECTOR_D = VECTOR_PREFIX + "LOAD_VECTOR_D" + POSTFIX; + static { + vectorNode(LOAD_VECTOR_D, "LoadVector", TYPE_DOUBLE); } public static final String LOAD_VECTOR_GATHER = PREFIX + "LOAD_VECTOR_GATHER" + POSTFIX; @@ -624,9 +762,29 @@ public class IRNode { beforeMatchingNameRegex(LSHIFT_L, "LShiftL"); } - public static final String LSHIFT_V = PREFIX + "LSHIFT_V" + POSTFIX; + public static final String LSHIFT_VB = VECTOR_PREFIX + "LSHIFT_VB" + POSTFIX; + static { + vectorNode(LSHIFT_VB, "LShiftVB", TYPE_BYTE); + } + + public static final String LSHIFT_VS = VECTOR_PREFIX + "LSHIFT_VS" + POSTFIX; + static { + vectorNode(LSHIFT_VS, "LShiftVS", TYPE_SHORT); + } + + public static final String LSHIFT_VC = VECTOR_PREFIX + "LSHIFT_VC" + POSTFIX; static { - beforeMatchingNameRegex(LSHIFT_V, "LShiftV(B|S|I|L)"); + vectorNode(LSHIFT_VC, "LShiftVS", TYPE_CHAR); // using short op with char type + } + + public static final String LSHIFT_VI = VECTOR_PREFIX + "LSHIFT_VI" + POSTFIX; + static { + vectorNode(LSHIFT_VI, "LShiftVI", TYPE_INT); + } + + public static final String LSHIFT_VL = VECTOR_PREFIX + "LSHIFT_VL" + POSTFIX; + static { + vectorNode(LSHIFT_VL, "LShiftVL", TYPE_LONG); } public static final String MACRO_LOGIC_V = PREFIX + "MACRO_LOGIC_V" + POSTFIX; @@ -669,9 +827,19 @@ public class IRNode { beforeMatchingNameRegex(MAX_L, "MaxL"); } - public static final String MAX_V = PREFIX + "MAX_V" + POSTFIX; + public static final String MAX_VI = VECTOR_PREFIX + "MAX_VI" + POSTFIX; static { - beforeMatchingNameRegex(MAX_V, "MaxV"); + vectorNode(MAX_VI, "MaxV", TYPE_INT); + } + + public static final String MAX_VF = VECTOR_PREFIX + "MAX_VF" + POSTFIX; + static { + vectorNode(MAX_VF, "MaxV", TYPE_FLOAT); + } + + public static final String MAX_VD = VECTOR_PREFIX + "MAX_VD" + POSTFIX; + static { + vectorNode(MAX_VD, "MaxV", TYPE_DOUBLE); } public static final String MEMBAR = PREFIX + "MEMBAR" + POSTFIX; @@ -719,9 +887,19 @@ public class IRNode { beforeMatchingNameRegex(MIN_L, "MinL"); } - public static final String MIN_V = PREFIX + "MIN_V" + POSTFIX; + public static final String MIN_VI = VECTOR_PREFIX + "MIN_VI" + POSTFIX; + static { + vectorNode(MIN_VI, "MinV", TYPE_INT); + } + + public static final String MIN_VF = VECTOR_PREFIX + "MIN_VF" + POSTFIX; static { - beforeMatchingNameRegex(MIN_V, "MinV"); + vectorNode(MIN_VF, "MinV", TYPE_FLOAT); + } + + public static final String MIN_VD = VECTOR_PREFIX + "MIN_VD" + POSTFIX; + static { + vectorNode(MIN_VD, "MinV", TYPE_DOUBLE); } public static final String MUL = PREFIX + "MUL" + POSTFIX; @@ -749,29 +927,34 @@ public class IRNode { beforeMatchingNameRegex(MUL_L, "MulL"); } - public static final String MUL_V = PREFIX + "MUL_V" + POSTFIX; + public static final String MUL_VL = VECTOR_PREFIX + "MUL_VL" + POSTFIX; + static { + vectorNode(MUL_VL, "MulVL", TYPE_LONG); + } + + public static final String MUL_VI = VECTOR_PREFIX + "MUL_VI" + POSTFIX; static { - beforeMatchingNameRegex(MUL_V, "MulV(B|S|I|L|F|D)"); + vectorNode(MUL_VI, "MulVI", TYPE_INT); } - public static final String MUL_VL = PREFIX + "MUL_VL" + POSTFIX; + public static final String MUL_VF = VECTOR_PREFIX + "MUL_VF" + POSTFIX; static { - beforeMatchingNameRegex(MUL_VL, "MulVL"); + vectorNode(MUL_VF, "MulVF", TYPE_FLOAT); } - public static final String MUL_VI = PREFIX + "MUL_VI" + POSTFIX; + public static final String MUL_VD = VECTOR_PREFIX + "MUL_VD" + POSTFIX; static { - beforeMatchingNameRegex(MUL_VI, "MulVI"); + vectorNode(MUL_VD, "MulVD", TYPE_DOUBLE); } - public static final String MUL_VF = PREFIX + "MUL_VF" + POSTFIX; + public static final String MUL_VB = VECTOR_PREFIX + "MUL_VB" + POSTFIX; static { - beforeMatchingNameRegex(MUL_VF, "MulVF"); + vectorNode(MUL_VB, "MulVB", TYPE_BYTE); } - public static final String MUL_VD = PREFIX + "MUL_VD" + POSTFIX; + public static final String MUL_VS = VECTOR_PREFIX + "MUL_VS" + POSTFIX; static { - beforeMatchingNameRegex(MUL_VD, "MulVD"); + vectorNode(MUL_VS, "MulVS", TYPE_SHORT); } public static final String MUL_REDUCTION_VD = PREFIX + "MUL_REDUCTION_VD" + POSTFIX; @@ -804,9 +987,14 @@ public class IRNode { superWordNodes(MAX_REDUCTION_V, "MaxReductionV"); } - public static final String NEG_V = PREFIX + "NEG_V" + POSTFIX; + public static final String NEG_VF = VECTOR_PREFIX + "NEG_VF" + POSTFIX; static { - beforeMatchingNameRegex(NEG_V, "NegV(F|D)"); + vectorNode(NEG_VF, "NegVF", TYPE_FLOAT); + } + + public static final String NEG_VD = VECTOR_PREFIX + "NEG_VD" + POSTFIX; + static { + vectorNode(NEG_VD, "NegVD", TYPE_DOUBLE); } public static final String NOP = PREFIX + "NOP" + POSTFIX; @@ -824,9 +1012,24 @@ public class IRNode { trapNodes(NULL_CHECK_TRAP,"null_check"); } - public static final String OR_V = PREFIX + "OR_V" + POSTFIX; + public static final String OR_VB = VECTOR_PREFIX + "OR_VB" + POSTFIX; + static { + vectorNode(OR_VB, "OrV", TYPE_BYTE); + } + + public static final String OR_VS = VECTOR_PREFIX + "OR_VS" + POSTFIX; + static { + vectorNode(OR_VS, "OrV", TYPE_SHORT); + } + + public static final String OR_VI = VECTOR_PREFIX + "OR_VI" + POSTFIX; static { - beforeMatchingNameRegex(OR_V, "OrV"); + vectorNode(OR_VI, "OrV", TYPE_INT); + } + + public static final String OR_VL = VECTOR_PREFIX + "OR_VL" + POSTFIX; + static { + vectorNode(OR_VL, "OrV", TYPE_LONG); } public static final String OR_V_MASK = PREFIX + "OR_V_MASK" + POSTFIX; @@ -855,24 +1058,24 @@ public class IRNode { beforeMatchingNameRegex(POPCOUNT_L, "PopCountL"); } - public static final String POPCOUNT_VI = PREFIX + "POPCOUNT_VI" + POSTFIX; + public static final String POPCOUNT_VI = VECTOR_PREFIX + "POPCOUNT_VI" + POSTFIX; static { - superWordNodes(POPCOUNT_VI, "PopCountVI"); + vectorNode(POPCOUNT_VI, "PopCountVI", TYPE_INT); } - public static final String POPCOUNT_VL = PREFIX + "POPCOUNT_VL" + POSTFIX; + public static final String POPCOUNT_VL = VECTOR_PREFIX + "POPCOUNT_VL" + POSTFIX; static { - superWordNodes(POPCOUNT_VL, "PopCountVL"); + vectorNode(POPCOUNT_VL, "PopCountVL", TYPE_LONG); } - public static final String COUNTTRAILINGZEROS_VL = PREFIX + "COUNTTRAILINGZEROS_VL" + POSTFIX; + public static final String COUNTTRAILINGZEROS_VL = VECTOR_PREFIX + "COUNTTRAILINGZEROS_VL" + POSTFIX; static { - superWordNodes(COUNTTRAILINGZEROS_VL, "CountTrailingZerosV"); + vectorNode(COUNTTRAILINGZEROS_VL, "CountTrailingZerosV", TYPE_LONG); } - public static final String COUNTLEADINGZEROS_VL = PREFIX + "COUNTLEADINGZEROS_VL" + POSTFIX; + public static final String COUNTLEADINGZEROS_VL = VECTOR_PREFIX + "COUNTLEADINGZEROS_VL" + POSTFIX; static { - superWordNodes(COUNTLEADINGZEROS_VL, "CountLeadingZerosV"); + vectorNode(COUNTLEADINGZEROS_VL, "CountLeadingZerosV", TYPE_LONG); } public static final String POPULATE_INDEX = PREFIX + "POPULATE_INDEX" + POSTFIX; @@ -941,9 +1144,24 @@ public class IRNode { CompilePhase.BEFORE_MATCHING)); } - public static final String REVERSE_BYTES_V = PREFIX + "REVERSE_BYTES_V" + POSTFIX; + public static final String REVERSE_BYTES_VB = VECTOR_PREFIX + "REVERSE_BYTES_VB" + POSTFIX; + static { + vectorNode(REVERSE_BYTES_VB, "ReverseBytesV", TYPE_BYTE); + } + + public static final String REVERSE_BYTES_VS = VECTOR_PREFIX + "REVERSE_BYTES_VS" + POSTFIX; + static { + vectorNode(REVERSE_BYTES_VS, "ReverseBytesV", TYPE_SHORT); + } + + public static final String REVERSE_BYTES_VI = VECTOR_PREFIX + "REVERSE_BYTES_VI" + POSTFIX; + static { + vectorNode(REVERSE_BYTES_VI, "ReverseBytesV", TYPE_INT); + } + + public static final String REVERSE_BYTES_VL = VECTOR_PREFIX + "REVERSE_BYTES_VL" + POSTFIX; static { - beforeMatchingNameRegex(REVERSE_BYTES_V, "ReverseBytesV"); + vectorNode(REVERSE_BYTES_VL, "ReverseBytesV", TYPE_LONG); } public static final String REVERSE_I = PREFIX + "REVERSE_I" + POSTFIX; @@ -956,19 +1174,24 @@ public class IRNode { beforeMatchingNameRegex(REVERSE_L, "ReverseL"); } - public static final String REVERSE_V = PREFIX + "REVERSE_V" + POSTFIX; + public static final String REVERSE_VI = VECTOR_PREFIX + "REVERSE_VI" + POSTFIX; + static { + vectorNode(REVERSE_VI, "ReverseV", TYPE_INT); + } + + public static final String REVERSE_VL = VECTOR_PREFIX + "REVERSE_VL" + POSTFIX; static { - beforeMatchingNameRegex(REVERSE_V, "ReverseV"); + vectorNode(REVERSE_VL, "ReverseV", TYPE_LONG); } - public static final String ROUND_VD = PREFIX + "ROUND_VD" + POSTFIX; + public static final String ROUND_VD = VECTOR_PREFIX + "ROUND_VD" + POSTFIX; static { - beforeMatchingNameRegex(ROUND_VD, "RoundVD"); + vectorNode(ROUND_VD, "RoundVD", TYPE_LONG); } - public static final String ROUND_VF = PREFIX + "ROUND_VF" + POSTFIX; + public static final String ROUND_VF = VECTOR_PREFIX + "ROUND_VF" + POSTFIX; static { - beforeMatchingNameRegex(ROUND_VF, "RoundVF"); + vectorNode(ROUND_VF, "RoundVF", TYPE_INT); } public static final String ROTATE_LEFT = PREFIX + "ROTATE_LEFT" + POSTFIX; @@ -991,9 +1214,9 @@ public class IRNode { beforeMatchingNameRegex(ROTATE_RIGHT_V, "RotateRightV"); } - public static final String ROUND_DOUBLE_MODE_V = PREFIX + "ROUND_DOUBLE_MODE_V" + POSTFIX; + public static final String ROUND_DOUBLE_MODE_V = VECTOR_PREFIX + "ROUND_DOUBLE_MODE_V" + POSTFIX; static { - beforeMatchingNameRegex(ROUND_DOUBLE_MODE_V, "RoundDoubleModeV"); + vectorNode(ROUND_DOUBLE_MODE_V, "RoundDoubleModeV", TYPE_DOUBLE); } public static final String RSHIFT = PREFIX + "RSHIFT" + POSTFIX; @@ -1011,19 +1234,29 @@ public class IRNode { beforeMatchingNameRegex(RSHIFT_L, "RShiftL"); } - public static final String RSHIFT_VB = PREFIX + "RSHIFT_VB" + POSTFIX; + public static final String RSHIFT_VB = VECTOR_PREFIX + "RSHIFT_VB" + POSTFIX; static { - beforeMatchingNameRegex(RSHIFT_VB, "RShiftVB"); + vectorNode(RSHIFT_VB, "RShiftVB", TYPE_BYTE); } - public static final String RSHIFT_VS = PREFIX + "RSHIFT_VS" + POSTFIX; + public static final String RSHIFT_VS = VECTOR_PREFIX + "RSHIFT_VS" + POSTFIX; static { - beforeMatchingNameRegex(RSHIFT_VS, "RShiftVS"); + vectorNode(RSHIFT_VS, "RShiftVS", TYPE_SHORT); } - public static final String RSHIFT_V = PREFIX + "RSHIFT_V" + POSTFIX; + public static final String RSHIFT_VC = VECTOR_PREFIX + "RSHIFT_VC" + POSTFIX; static { - beforeMatchingNameRegex(RSHIFT_V, "RShiftV(B|S|I|L)"); + vectorNode(RSHIFT_VC, "RShiftVS", TYPE_CHAR); // short computation with char type + } + + public static final String RSHIFT_VI = VECTOR_PREFIX + "RSHIFT_VI" + POSTFIX; + static { + vectorNode(RSHIFT_VI, "RShiftVI", TYPE_INT); + } + + public static final String RSHIFT_VL = VECTOR_PREFIX + "RSHIFT_VL" + POSTFIX; + static { + vectorNode(RSHIFT_VL, "RShiftVL", TYPE_LONG); } public static final String SAFEPOINT = PREFIX + "SAFEPOINT" + POSTFIX; @@ -1037,19 +1270,24 @@ public class IRNode { optoOnly(SCOPE_OBJECT, regex); } - public static final String SIGNUM_VD = PREFIX + "SIGNUM_VD" + POSTFIX; + public static final String SIGNUM_VD = VECTOR_PREFIX + "SIGNUM_VD" + POSTFIX; static { - beforeMatchingNameRegex(SIGNUM_VD, "SignumVD"); + vectorNode(SIGNUM_VD, "SignumVD", TYPE_DOUBLE); } - public static final String SIGNUM_VF = PREFIX + "SIGNUM_VF" + POSTFIX; + public static final String SIGNUM_VF = VECTOR_PREFIX + "SIGNUM_VF" + POSTFIX; static { - beforeMatchingNameRegex(SIGNUM_VF, "SignumVF"); + vectorNode(SIGNUM_VF, "SignumVF", TYPE_FLOAT); } - public static final String SQRT_V = PREFIX + "SQRT_V" + POSTFIX; + public static final String SQRT_VF = VECTOR_PREFIX + "SQRT_VF" + POSTFIX; static { - beforeMatchingNameRegex(SQRT_V, "SqrtV(F|D)"); + vectorNode(SQRT_VF, "SqrtVF", TYPE_FLOAT); + } + + public static final String SQRT_VD = VECTOR_PREFIX + "SQRT_VD" + POSTFIX; + static { + vectorNode(SQRT_VD, "SqrtVD", TYPE_DOUBLE); } public static final String STORE = PREFIX + "STORE" + POSTFIX; @@ -1188,9 +1426,34 @@ public class IRNode { beforeMatchingNameRegex(SUB_L, "SubL"); } - public static final String SUB_V = PREFIX + "SUB_V" + POSTFIX; + public static final String SUB_VB = VECTOR_PREFIX + "SUB_VB" + POSTFIX; + static { + vectorNode(SUB_VB, "SubVB", TYPE_BYTE); + } + + public static final String SUB_VS = VECTOR_PREFIX + "SUB_VS" + POSTFIX; + static { + vectorNode(SUB_VS, "SubVS", TYPE_SHORT); + } + + public static final String SUB_VI = VECTOR_PREFIX + "SUB_VI" + POSTFIX; static { - beforeMatchingNameRegex(SUB_V, "SubV(B|S|I|L|F|D)"); + vectorNode(SUB_VI, "SubVI", TYPE_INT); + } + + public static final String SUB_VL = VECTOR_PREFIX + "SUB_VL" + POSTFIX; + static { + vectorNode(SUB_VL, "SubVL", TYPE_LONG); + } + + public static final String SUB_VF = VECTOR_PREFIX + "SUB_VF" + POSTFIX; + static { + vectorNode(SUB_VF, "SubVF", TYPE_FLOAT); + } + + public static final String SUB_VD = VECTOR_PREFIX + "SUB_VD" + POSTFIX; + static { + vectorNode(SUB_VD, "SubVD", TYPE_DOUBLE); } public static final String SUBTYPE_CHECK = PREFIX + "SUBTYPE_CHECK" + POSTFIX; @@ -1268,9 +1531,29 @@ public class IRNode { beforeMatchingNameRegex(URSHIFT_S, "URShiftS"); } - public static final String URSHIFT_V = PREFIX + "URSHIFT_V" + POSTFIX; + public static final String URSHIFT_VB = VECTOR_PREFIX + "URSHIFT_VB" + POSTFIX; static { - beforeMatchingNameRegex(URSHIFT_V, "URShiftV(B|S|I|L)"); + vectorNode(URSHIFT_VB, "URShiftVB", TYPE_BYTE); + } + + public static final String URSHIFT_VS = VECTOR_PREFIX + "URSHIFT_VS" + POSTFIX; + static { + vectorNode(URSHIFT_VS, "URShiftVS", TYPE_SHORT); + } + + public static final String URSHIFT_VC = VECTOR_PREFIX + "URSHIFT_VC" + POSTFIX; + static { + vectorNode(URSHIFT_VC, "URShiftVS", TYPE_CHAR); // short computation with char type + } + + public static final String URSHIFT_VI = VECTOR_PREFIX + "URSHIFT_VI" + POSTFIX; + static { + vectorNode(URSHIFT_VI, "URShiftVI", TYPE_INT); + } + + public static final String URSHIFT_VL = VECTOR_PREFIX + "URSHIFT_VL" + POSTFIX; + static { + vectorNode(URSHIFT_VL, "URShiftVL", TYPE_LONG); } public static final String VAND_NOT_I = PREFIX + "VAND_NOT_I" + POSTFIX; @@ -1283,54 +1566,199 @@ public class IRNode { machOnlyNameRegex(VAND_NOT_L, "vand_notL"); } - public static final String VECTOR_BLEND = PREFIX + "VECTOR_BLEND" + POSTFIX; + public static final String VECTOR_BLEND_B = VECTOR_PREFIX + "VECTOR_BLEND_B" + POSTFIX; + static { + vectorNode(VECTOR_BLEND_B, "VectorBlend", TYPE_BYTE); + } + + public static final String VECTOR_BLEND_F = VECTOR_PREFIX + "VECTOR_BLEND_F" + POSTFIX; + static { + vectorNode(VECTOR_BLEND_F, "VectorBlend", TYPE_FLOAT); + } + + public static final String VECTOR_BLEND_D = VECTOR_PREFIX + "VECTOR_BLEND_D" + POSTFIX; + static { + vectorNode(VECTOR_BLEND_D, "VectorBlend", TYPE_DOUBLE); + } + + public static final String VECTOR_MASK_CMP_I = VECTOR_PREFIX + "VECTOR_MASK_CMP_I" + POSTFIX; + static { + vectorNode(VECTOR_MASK_CMP_I, "VectorMaskCmp", TYPE_INT); + } + + public static final String VECTOR_MASK_CMP_L = VECTOR_PREFIX + "VECTOR_MASK_CMP_L" + POSTFIX; + static { + vectorNode(VECTOR_MASK_CMP_L, "VectorMaskCmp", TYPE_LONG); + } + + public static final String VECTOR_MASK_CMP_F = VECTOR_PREFIX + "VECTOR_MASK_CMP_F" + POSTFIX; + static { + vectorNode(VECTOR_MASK_CMP_F, "VectorMaskCmp", TYPE_FLOAT); + } + + public static final String VECTOR_MASK_CMP_D = VECTOR_PREFIX + "VECTOR_MASK_CMP_D" + POSTFIX; + static { + vectorNode(VECTOR_MASK_CMP_D, "VectorMaskCmp", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_B2S = VECTOR_PREFIX + "VECTOR_CAST_B2S" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2S, "VectorCastB2X", TYPE_SHORT); + } + + public static final String VECTOR_CAST_B2I = VECTOR_PREFIX + "VECTOR_CAST_B2I" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2I, "VectorCastB2X", TYPE_INT); + } + + public static final String VECTOR_CAST_B2L = VECTOR_PREFIX + "VECTOR_CAST_B2L" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2L, "VectorCastB2X", TYPE_LONG); + } + + public static final String VECTOR_CAST_B2F = VECTOR_PREFIX + "VECTOR_CAST_B2F" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2F, "VectorCastB2X", TYPE_FLOAT); + } + + public static final String VECTOR_CAST_B2D = VECTOR_PREFIX + "VECTOR_CAST_B2D" + POSTFIX; + static { + vectorNode(VECTOR_CAST_B2D, "VectorCastB2X", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_D2B = VECTOR_PREFIX + "VECTOR_CAST_D2B" + POSTFIX; + static { + vectorNode(VECTOR_CAST_D2B, "VectorCastD2X", TYPE_BYTE); + } + + public static final String VECTOR_CAST_D2S = VECTOR_PREFIX + "VECTOR_CAST_D2S" + POSTFIX; + static { + vectorNode(VECTOR_CAST_D2S, "VectorCastD2X", TYPE_SHORT); + } + + public static final String VECTOR_CAST_D2I = VECTOR_PREFIX + "VECTOR_CAST_D2I" + POSTFIX; + static { + vectorNode(VECTOR_CAST_D2I, "VectorCastD2X", TYPE_INT); + } + + public static final String VECTOR_CAST_D2L = VECTOR_PREFIX + "VECTOR_CAST_D2L" + POSTFIX; + static { + vectorNode(VECTOR_CAST_D2L, "VectorCastD2X", TYPE_LONG); + } + + public static final String VECTOR_CAST_D2F = VECTOR_PREFIX + "VECTOR_CAST_D2F" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_BLEND, "VectorBlend"); + vectorNode(VECTOR_CAST_D2F, "VectorCastD2X", TYPE_FLOAT); } - public static final String VECTOR_MASK_CMP = PREFIX + "VECTOR_MASK_CMP" + POSTFIX; + public static final String VECTOR_CAST_F2B = VECTOR_PREFIX + "VECTOR_CAST_F2B" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_MASK_CMP, "VectorMaskCmp"); + vectorNode(VECTOR_CAST_F2B, "VectorCastF2X", TYPE_BYTE); } - public static final String VECTOR_CAST_B2X = PREFIX + "VECTOR_CAST_B2X" + POSTFIX; + public static final String VECTOR_CAST_F2S = VECTOR_PREFIX + "VECTOR_CAST_F2S" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_B2X, "VectorCastB2X"); + vectorNode(VECTOR_CAST_F2S, "VectorCastF2X", TYPE_SHORT); } - public static final String VECTOR_CAST_D2X = PREFIX + "VECTOR_CAST_D2X" + POSTFIX; + public static final String VECTOR_CAST_F2I = VECTOR_PREFIX + "VECTOR_CAST_F2I" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_D2X, "VectorCastD2X"); + vectorNode(VECTOR_CAST_F2I, "VectorCastF2X", TYPE_INT); } - public static final String VECTOR_CAST_F2X = PREFIX + "VECTOR_CAST_F2X" + POSTFIX; + public static final String VECTOR_CAST_F2L = VECTOR_PREFIX + "VECTOR_CAST_F2L" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_F2X, "VectorCastF2X"); + vectorNode(VECTOR_CAST_F2L, "VectorCastF2X", TYPE_LONG); } - public static final String VECTOR_CAST_I2X = PREFIX + "VECTOR_CAST_I2X" + POSTFIX; + public static final String VECTOR_CAST_F2D = VECTOR_PREFIX + "VECTOR_CAST_F2D" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_I2X, "VectorCastI2X"); + vectorNode(VECTOR_CAST_F2D, "VectorCastF2X", TYPE_DOUBLE); } - public static final String VECTOR_CAST_L2X = PREFIX + "VECTOR_CAST_L2X" + POSTFIX; + public static final String VECTOR_CAST_I2B = VECTOR_PREFIX + "VECTOR_CAST_I2B" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_L2X, "VectorCastL2X"); + vectorNode(VECTOR_CAST_I2B, "VectorCastI2X", TYPE_BYTE); } - public static final String VECTOR_CAST_S2X = PREFIX + "VECTOR_CAST_S2X" + POSTFIX; + public static final String VECTOR_CAST_I2S = VECTOR_PREFIX + "VECTOR_CAST_I2S" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_S2X, "VectorCastS2X"); + vectorNode(VECTOR_CAST_I2S, "VectorCastI2X", TYPE_SHORT); } - public static final String VECTOR_CAST_F2HF = PREFIX + "VECTOR_CAST_F2HF" + POSTFIX; + public static final String VECTOR_CAST_I2L = VECTOR_PREFIX + "VECTOR_CAST_I2L" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_F2HF, "VectorCastF2HF"); + vectorNode(VECTOR_CAST_I2L, "VectorCastI2X", TYPE_LONG); } - public static final String VECTOR_CAST_HF2F = PREFIX + "VECTOR_CAST_HF2F" + POSTFIX; + public static final String VECTOR_CAST_I2F = VECTOR_PREFIX + "VECTOR_CAST_I2F" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_CAST_HF2F, "VectorCastHF2F"); + vectorNode(VECTOR_CAST_I2F, "VectorCastI2X", TYPE_FLOAT); + } + + public static final String VECTOR_CAST_I2D = VECTOR_PREFIX + "VECTOR_CAST_I2D" + POSTFIX; + static { + vectorNode(VECTOR_CAST_I2D, "VectorCastI2X", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_L2B = VECTOR_PREFIX + "VECTOR_CAST_L2B" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2B, "VectorCastL2X", TYPE_BYTE); + } + + public static final String VECTOR_CAST_L2S = VECTOR_PREFIX + "VECTOR_CAST_L2S" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2S, "VectorCastL2X", TYPE_SHORT); + } + + public static final String VECTOR_CAST_L2I = VECTOR_PREFIX + "VECTOR_CAST_L2I" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2I, "VectorCastL2X", TYPE_INT); + } + + public static final String VECTOR_CAST_L2F = VECTOR_PREFIX + "VECTOR_CAST_L2F" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2F, "VectorCastL2X", TYPE_FLOAT); + } + + public static final String VECTOR_CAST_L2D = VECTOR_PREFIX + "VECTOR_CAST_L2D" + POSTFIX; + static { + vectorNode(VECTOR_CAST_L2D, "VectorCastL2X", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_S2B = VECTOR_PREFIX + "VECTOR_CAST_S2B" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2B, "VectorCastS2X", TYPE_BYTE); + } + + public static final String VECTOR_CAST_S2I = VECTOR_PREFIX + "VECTOR_CAST_S2I" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2I, "VectorCastS2X", TYPE_INT); + } + + public static final String VECTOR_CAST_S2L = VECTOR_PREFIX + "VECTOR_CAST_S2L" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2L, "VectorCastS2X", TYPE_LONG); + } + + public static final String VECTOR_CAST_S2F = VECTOR_PREFIX + "VECTOR_CAST_S2F" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2F, "VectorCastS2X", TYPE_FLOAT); + } + + public static final String VECTOR_CAST_S2D = VECTOR_PREFIX + "VECTOR_CAST_S2D" + POSTFIX; + static { + vectorNode(VECTOR_CAST_S2D, "VectorCastS2X", TYPE_DOUBLE); + } + + public static final String VECTOR_CAST_F2HF = VECTOR_PREFIX + "VECTOR_CAST_F2HF" + POSTFIX; + static { + vectorNode(VECTOR_CAST_F2HF, "VectorCastF2HF", TYPE_SHORT); + } + + public static final String VECTOR_CAST_HF2F = VECTOR_PREFIX + "VECTOR_CAST_HF2F" + POSTFIX; + static { + vectorNode(VECTOR_CAST_HF2F, "VectorCastHF2F", TYPE_FLOAT); } public static final String VECTOR_MASK_CAST = PREFIX + "VECTOR_MASK_CAST" + POSTFIX; @@ -1343,19 +1771,34 @@ public class IRNode { beforeMatchingNameRegex(VECTOR_REINTERPRET, "VectorReinterpret"); } - public static final String VECTOR_UCAST_B2X = PREFIX + "VECTOR_UCAST_B2X" + POSTFIX; + public static final String VECTOR_UCAST_B2S = VECTOR_PREFIX + "VECTOR_UCAST_B2S" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_UCAST_B2X, "VectorUCastB2X"); + vectorNode(VECTOR_UCAST_B2S, "VectorUCastB2X", TYPE_SHORT); } - public static final String VECTOR_UCAST_I2X = PREFIX + "VECTOR_UCAST_I2X" + POSTFIX; + public static final String VECTOR_UCAST_B2I = VECTOR_PREFIX + "VECTOR_UCAST_B2I" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_UCAST_I2X, "VectorUCastI2X"); + vectorNode(VECTOR_UCAST_B2I, "VectorUCastB2X", TYPE_INT); } - public static final String VECTOR_UCAST_S2X = PREFIX + "VECTOR_UCAST_S2X" + POSTFIX; + public static final String VECTOR_UCAST_B2L = VECTOR_PREFIX + "VECTOR_UCAST_B2L" + POSTFIX; static { - beforeMatchingNameRegex(VECTOR_UCAST_S2X, "VectorUCastS2X"); + vectorNode(VECTOR_UCAST_B2L, "VectorUCastB2X", TYPE_LONG); + } + + public static final String VECTOR_UCAST_I2L = VECTOR_PREFIX + "VECTOR_UCAST_I2L" + POSTFIX; + static { + vectorNode(VECTOR_UCAST_I2L, "VectorUCastI2X", TYPE_LONG); + } + + public static final String VECTOR_UCAST_S2I = VECTOR_PREFIX + "VECTOR_UCAST_S2I" + POSTFIX; + static { + vectorNode(VECTOR_UCAST_S2I, "VectorUCastS2X", TYPE_INT); + } + + public static final String VECTOR_UCAST_S2L = VECTOR_PREFIX + "VECTOR_UCAST_S2L" + POSTFIX; + static { + vectorNode(VECTOR_UCAST_S2L, "VectorUCastS2X", TYPE_LONG); } public static final String VECTOR_TEST = PREFIX + "VECTOR_TEST" + POSTFIX; @@ -1538,9 +1981,24 @@ public class IRNode { beforeMatchingNameRegex(XOR_L, "XorL"); } - public static final String XOR_V = PREFIX + "XOR_V" + POSTFIX; + public static final String XOR_VB = VECTOR_PREFIX + "XOR_VB" + POSTFIX; + static { + vectorNode(XOR_VB, "XorV", TYPE_BYTE); + } + + public static final String XOR_VS = VECTOR_PREFIX + "XOR_VS" + POSTFIX; + static { + vectorNode(XOR_VS, "XorV", TYPE_SHORT); + } + + public static final String XOR_VI = VECTOR_PREFIX + "XOR_VI" + POSTFIX; + static { + vectorNode(XOR_VI, "XorV", TYPE_INT); + } + + public static final String XOR_VL = VECTOR_PREFIX + "XOR_VL" + POSTFIX; static { - beforeMatchingNameRegex(XOR_V, "XorV"); + vectorNode(XOR_VL, "XorV", TYPE_LONG); } public static final String XOR_V_MASK = PREFIX + "XOR_V_MASK" + POSTFIX; @@ -1563,14 +2021,24 @@ public class IRNode { machOnlyNameRegex(XOR3_SVE, "veor3_sve"); } - public static final String COMPRESS_BITSV = PREFIX + "COMPRESS_BITSV" + POSTFIX; + public static final String COMPRESS_BITS_VI = VECTOR_PREFIX + "COMPRESS_BITS_VI" + POSTFIX; + static { + vectorNode(COMPRESS_BITS_VI, "CompressBitsV", TYPE_INT); + } + + public static final String COMPRESS_BITS_VL = VECTOR_PREFIX + "COMPRESS_BITS_VL" + POSTFIX; static { - beforeMatchingNameRegex(COMPRESS_BITSV, "CompressBitsV"); + vectorNode(COMPRESS_BITS_VL, "CompressBitsV", TYPE_LONG); } - public static final String EXPAND_BITSV = PREFIX + "EXPAND_BITSV" + POSTFIX; + public static final String EXPAND_BITS_VI = VECTOR_PREFIX + "EXPAND_BITS_VI" + POSTFIX; static { - beforeMatchingNameRegex(EXPAND_BITSV, "ExpandBitsV"); + vectorNode(EXPAND_BITS_VI, "ExpandBitsV", TYPE_INT); + } + + public static final String EXPAND_BITS_VL = VECTOR_PREFIX + "EXPAND_BITS_VL" + POSTFIX; + static { + vectorNode(EXPAND_BITS_VL, "ExpandBitsV", TYPE_LONG); } public static final String Z_LOAD_P_WITH_BARRIER_FLAG = COMPOSITE_PREFIX + "Z_LOAD_P_WITH_BARRIER_FLAG" + POSTFIX; @@ -1672,6 +2140,20 @@ private static void beforeMatchingNameRegex(String irNodePlaceholder, String irN IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex)); } + /** + * Apply {@code irNodeRegex} as regex for the IR vector node name on all machine independent ideal graph phases up to and + * including {@link CompilePhase#BEFORE_MATCHING}. Since this is a vector node, we can also check the vector element + * type {@code typeString} and the vector size (number of elements), {@see VECTOR_SIZE}. + */ + private static void vectorNode(String irNodePlaceholder, String irNodeRegex, String typeString) { + TestFramework.check(isVectorIRNode(irNodePlaceholder), "vectorNode: failed prefix check for irNodePlaceholder " + + irNodePlaceholder + " -> did you use VECTOR_PREFIX?"); + // IS_REPLACED is later replaced with the specific type and size of the vector. + String regex = START + irNodeRegex + MID + IS_REPLACED + END; + IR_NODE_MAPPINGS.put(irNodePlaceholder, new RegexTypeEntry(RegexType.IDEAL_INDEPENDENT, regex)); + VECTOR_NODE_TYPE.put(irNodePlaceholder, typeString); + } + private static void allocNodes(String irNode, String irNodeName, String optoRegex) { String idealIndependentRegex = START + irNodeName + "\\b" + MID + END; Map intervalToRegexMap = new HashMap<>(); @@ -1787,6 +2269,149 @@ public static boolean isCompositeIRNode(String irCompositeNodeString) { return irCompositeNodeString.startsWith(COMPOSITE_PREFIX); } + /** + * Is {@code irVectorNodeString} an IR vector node placeholder string? + */ + public static boolean isVectorIRNode(String irVectorNodeString) { + return irVectorNodeString.startsWith(VECTOR_PREFIX); + } + + /** + * Is {@code irVectorSizeString} a vector size string? + */ + public static boolean isVectorSize(String irVectorSizeString) { + return irVectorSizeString.startsWith(VECTOR_SIZE); + } + + /** + * Parse {@code sizeString} and generate a regex pattern to match for the size in the IR dump. + */ + public static String parseVectorNodeSize(String sizeString, String typeString, VMInfo vmInfo) { + if (sizeString.equals(VECTOR_SIZE_TAG_ANY)) { + return "\\\\d+"; // match with any number + } + // Try to parse any tags, convert to comma separated list of ints + sizeString = parseVectorNodeSizeTag(sizeString, typeString, vmInfo); + // Parse comma separated list of numbers + String[] sizes = sizeString.split(","); + String regex = ""; + for (int i = 0; i < sizes.length; i++) { + int size = 0; + try { + size = Integer.parseInt(sizes[i]); + } catch (NumberFormatException e) { + throw new TestFormatException("Vector node has invalid size \"" + sizes[i] + "\", in \"" + sizeString + "\""); + } + TestFormat.checkNoReport(size > 1, "Vector node size must be 2 or larger, but got \"" + sizes[i] + "\", in \"" + sizeString + "\""); + regex += ((i > 0) ? "|" : "") + size; + } + if (sizes.length > 1) { + regex = "(" + regex + ")"; + } + return regex; + } + + /** + * If {@code sizeTagString} is a size tag, return the list of accepted sizes, else return sizeTagString. + */ + public static String parseVectorNodeSizeTag(String sizeTagString, String typeString, VMInfo vmInfo) { + // Parse out "min(a,b,c,...)" + if (sizeTagString.startsWith("min(") && sizeTagString.endsWith(")")) { + return parseVectorNodeSizeTagMin(sizeTagString, typeString, vmInfo); + } + + // Parse individual tags + return switch (sizeTagString) { + case VECTOR_SIZE_TAG_MAX -> String.valueOf(getMaxElementsForType(typeString, vmInfo)); + case "max_byte" -> String.valueOf(getMaxElementsForType(TYPE_BYTE, vmInfo)); + case "max_char" -> String.valueOf(getMaxElementsForType(TYPE_CHAR, vmInfo)); + case "max_short" -> String.valueOf(getMaxElementsForType(TYPE_SHORT, vmInfo)); + case "max_int" -> String.valueOf(getMaxElementsForType(TYPE_INT, vmInfo)); + case "max_long" -> String.valueOf(getMaxElementsForType(TYPE_LONG, vmInfo)); + case "max_float" -> String.valueOf(getMaxElementsForType(TYPE_FLOAT, vmInfo)); + case "max_double" -> String.valueOf(getMaxElementsForType(TYPE_DOUBLE, vmInfo)); + case "LoopMaxUnroll" -> String.valueOf(vmInfo.getLongValue("LoopMaxUnroll")); + default -> sizeTagString; + }; + } + + /** + * Parse {@code sizeTagString}, which must be a min-clause. + */ + public static String parseVectorNodeSizeTagMin(String sizeTagString, String typeString, VMInfo vmInfo) { + String[] tags = sizeTagString.substring(4, sizeTagString.length() - 1).split(","); + TestFormat.checkNoReport(tags.length > 1, "Vector node size \"min(...)\" must have at least 2 comma separated arguments, got \"" + sizeTagString + "\""); + int minVal = 1024; + for (int i = 0; i < tags.length; i++) { + String tag = parseVectorNodeSizeTag(tags[i].trim(), typeString, vmInfo); + int tag_val = 0; + try { + tag_val = Integer.parseInt(tag); + } catch (NumberFormatException e) { + throw new TestFormatException("Vector node has invalid size in \"min(...)\", argument " + i + ", \"" + tag + "\", in \"" + sizeTagString + "\""); + } + minVal = Math.min(minVal, tag_val); + } + return String.valueOf(minVal); + } + + /** + * Return maximal number of elements that can fit in a vector of the specified type. + */ + public static long getMaxElementsForType(String typeString, VMInfo vmInfo) { + long maxVectorSize = vmInfo.getLongValue("MaxVectorSize"); + TestFormat.checkNoReport(maxVectorSize > 0, "VMInfo: MaxVectorSize is not larger than zero"); + long maxBytes = maxVectorSize; + + if (Platform.isX64() || Platform.isX86()) { + maxBytes = Math.min(maxBytes, getMaxElementsForTypeOnX86(typeString, vmInfo)); + } + + // compute elements per vector: vector bytes divided by bytes per element + int bytes = getTypeSizeInBytes(typeString); + return maxBytes / bytes; + } + + /** + * Return maximal number of elements that can fit in a vector of the specified type, on x86 / x64. + */ + public static long getMaxElementsForTypeOnX86(String typeString, VMInfo vmInfo) { + // restrict maxBytes for specific features, see Matcher::vector_width_in_bytes in x86.ad: + boolean avx1 = vmInfo.hasCPUFeature("avx"); + boolean avx2 = vmInfo.hasCPUFeature("avx2"); + boolean avx512 = vmInfo.hasCPUFeature("avx512f"); + boolean avx512bw = vmInfo.hasCPUFeature("avx512bw"); + long maxBytes; + if (avx512) { + maxBytes = 64; + } else if (avx2) { + maxBytes = 32; + } else { + maxBytes = 16; + } + if (avx1 && (typeString.equals(TYPE_FLOAT) || typeString.equals(TYPE_DOUBLE))) { + maxBytes = avx512 ? 64 : 32; + } + if (avx512 && (typeString.equals(TYPE_BYTE) || typeString.equals(TYPE_SHORT) || typeString.equals(TYPE_CHAR))) { + maxBytes = avx512bw ? 64 : 32; + } + + return maxBytes; + } + + /** + * Return size in bytes of type named by {@code typeString}, return 0 if it does not name a type. + */ + public static int getTypeSizeInBytes(String typeString) { + return switch (typeString) { + case TYPE_BYTE -> 1; + case TYPE_CHAR, TYPE_SHORT -> 2; + case TYPE_INT, TYPE_FLOAT -> 4; + case TYPE_LONG, TYPE_DOUBLE -> 8; + default -> 0; + }; + } + /** * Returns "IRNode.XYZ", where XYZ is one of the IR node placeholder variable names defined above. */ @@ -1796,6 +2421,10 @@ public static String getIRNodeAccessString(String irNodeString) { TestFramework.check(irNodeString.length() > COMPOSITE_PREFIX.length() + POSTFIX.length(), "Invalid composite node placeholder: " + irNodeString); prefixLength = COMPOSITE_PREFIX.length(); + } else if (isVectorIRNode(irNodeString)) { + TestFramework.check(irNodeString.length() > VECTOR_PREFIX.length() + POSTFIX.length(), + "Invalid vector node placeholder: " + irNodeString); + prefixLength = VECTOR_PREFIX.length(); } else { prefixLength = PREFIX.length(); } @@ -1870,4 +2499,11 @@ public static CompilePhase getDefaultPhase(String irNode) { TestFormat.checkNoReport(entry != null, failMsg); return entry.defaultCompilePhase(); } + + public static String getVectorNodeType(String irNode) { + String typeString = VECTOR_NODE_TYPE.get(irNode); + String failMsg = "\"" + irNode + "\" is not a Vector IR node defined in class IRNode"; + TestFormat.check(typeString != null, failMsg); + return typeString; + } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/README.md b/test/hotspot/jtreg/compiler/lib/ir_framework/README.md index 90ac8674096..2297b6bbc17 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/README.md +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/README.md @@ -71,6 +71,26 @@ public void test() { } ``` +#### Vector IR Nodes +For vector nodes, we not only check for the presence of the node, but also its type and size (number of elements in the vector). Every node has an associated type, for example `IRNode.LOAD_VECTOR_I` has type `int` and `IRNode.LOAD_VECTOR_F` has type `float`. The size can be explicitly specified as an additional argument. For example: + +``` +@IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIf = {"MaxVectorSize", "=64"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) +static float[] test() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length; i++) { + a[i]++; + } + return a; +} +``` + +However, the size does not have to be specified. In most cases, one either wants to have vectorization at the maximal possible vector width, or no vectorization at all. Hence, for lower bound counts ('>' or '>=') and equal count comparisons with strictly positive count (e.g. "=2") the default size is `IRNode.VECTOR_SIZE_MAX`, and for upper bound counts ('<' or '<=' or '=0' or failOn) the default is `IRNode.VECTOR_SIZE_ANY`. On machines with 'canTrustVectorSize == false' (default Cascade Lake) the maximal vector width is not predictable currently (32 byte for SuperWord and 64 byte for VectorAPI). Hence, on such a machine we have to automatically weaken the IR rules. All lower bound counts are performed checking with `IRNode.VECTOR_SIZE_ANY`. Upper bound counts with no user specified size are performed with `IRNode.VECTOR_SIZE_ANY` but upper bound counts with a user specified size are not checked at all. Equal count comparisons with strictly positive count are also not checked at all. Details and reasoning can be found in [RawIRNode](./driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java). + +More examples can be found in [IRExample](../../../testlibrary_tests/ir_framework/examples/IRExample.java). You can also find many examples in the Vector API and SuperWord tests, when searching for `IRNode.VECTOR_SIZE` or `IRNode.LOAD_VECTOR`. + #### User-defined Regexes The user can also directly specify user-defined regexes in combination with a required compile phase (there is no default compile phase known by the framework for custom regexes). If such a user-defined regex represents a not yet supported C2 IR node, it is highly encouraged to directly add a new IR node placeholder string definition to [IRNode](./IRNode.java) for it instead together with a static regex mapping block. diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/SuccessOnlyConstraintException.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/SuccessOnlyConstraintException.java new file mode 100644 index 00000000000..452e9a666c9 --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/SuccessOnlyConstraintException.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.lib.ir_framework.driver; + +import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; + +/** + * Exception used to signal that a {@link Constraint} should always succeed. + */ +public class SuccessOnlyConstraintException extends RuntimeException { + public SuccessOnlyConstraintException(String message) { + super("Unhandled SuccessOnlyConstraintException, should have created a Constraint that always succeeds:" + System.lineSeparator() + message); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irmethod/IRMethod.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irmethod/IRMethod.java index 40d36a6090e..dbd431d22e0 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irmethod/IRMethod.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irmethod/IRMethod.java @@ -31,6 +31,7 @@ import compiler.lib.ir_framework.driver.irmatching.Matchable; import compiler.lib.ir_framework.driver.irmatching.MatchableMatcher; import compiler.lib.ir_framework.driver.irmatching.irrule.IRRule; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; import compiler.lib.ir_framework.shared.TestFormat; import compiler.lib.ir_framework.shared.TestFormatException; @@ -50,16 +51,16 @@ public class IRMethod implements IRMethodMatchable { private final Method method; private final MatchableMatcher matcher; - public IRMethod(Method method, int[] ruleIds, IR[] irAnnos, Compilation compilation) { + public IRMethod(Method method, int[] ruleIds, IR[] irAnnos, Compilation compilation, VMInfo vmInfo) { this.method = method; - this.matcher = new MatchableMatcher(createIRRules(method, ruleIds, irAnnos, compilation)); + this.matcher = new MatchableMatcher(createIRRules(method, ruleIds, irAnnos, compilation, vmInfo)); } - private List createIRRules(Method method, int[] ruleIds, IR[] irAnnos, Compilation compilation) { + private List createIRRules(Method method, int[] ruleIds, IR[] irAnnos, Compilation compilation, VMInfo vmInfo) { List irRules = new ArrayList<>(); for (int ruleId : ruleIds) { try { - irRules.add(new IRRule(ruleId, irAnnos[ruleId - 1], compilation)); + irRules.add(new IRRule(ruleId, irAnnos[ruleId - 1], compilation, vmInfo)); } catch (TestFormatException e) { String postfixErrorMsg = " for IR rule " + ruleId + " at " + method + "."; TestFormat.failNoThrow(e.getMessage() + postfixErrorMsg); diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/IRRule.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/IRRule.java index ff768d6540f..749942eabd6 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/IRRule.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/IRRule.java @@ -31,6 +31,7 @@ import compiler.lib.ir_framework.driver.irmatching.MatchableMatcher; import compiler.lib.ir_framework.driver.irmatching.irrule.phase.CompilePhaseIRRule; import compiler.lib.ir_framework.driver.irmatching.irrule.phase.CompilePhaseIRRuleBuilder; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; /** * This class represents a generic {@link IR @IR} rule of an IR method. It contains a list of compile phase specific @@ -44,10 +45,10 @@ public class IRRule implements Matchable { private final IR irAnno; private final MatchableMatcher matcher; - public IRRule(int ruleId, IR irAnno, Compilation compilation) { + public IRRule(int ruleId, IR irAnno, Compilation compilation, VMInfo vmInfo) { this.ruleId = ruleId; this.irAnno = irAnno; - this.matcher = new MatchableMatcher(new CompilePhaseIRRuleBuilder(irAnno, compilation).build()); + this.matcher = new MatchableMatcher(new CompilePhaseIRRuleBuilder(irAnno, compilation).build(vmInfo)); } @Override diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/CheckAttributeReader.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/CheckAttributeReader.java index 14ba26aeb38..ab3a8971562 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/CheckAttributeReader.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/CheckAttributeReader.java @@ -60,16 +60,34 @@ public void read(Collection result) { public final CheckAttributeString readUserPostfix(String node) { if (IRNode.isCompositeIRNode(node)) { - String irNode = IRNode.getIRNodeAccessString(node); - int nextIndex = iterator.nextIndex(); - TestFormat.checkNoReport(iterator.hasNext(), "Must provide additional value at index " + - nextIndex + " right after " + irNode); - CheckAttributeString userPostfix = new CheckAttributeString(iterator.next()); - TestFormat.checkNoReport(userPostfix.isValidUserPostfix(), "Provided empty string for composite node " + - irNode + " at index " + nextIndex); - return userPostfix; + return readUserPostfixForCompositeIRNode(node); + } else if (IRNode.isVectorIRNode(node)) { + return readUserPostfixForVectorIRNode(node); } else { return CheckAttributeString.invalid(); } } + + private final CheckAttributeString readUserPostfixForCompositeIRNode(String node) { + String irNode = IRNode.getIRNodeAccessString(node); + int nextIndex = iterator.nextIndex(); + TestFormat.checkNoReport(iterator.hasNext(), "Must provide additional value at index " + + nextIndex + " right after " + irNode); + CheckAttributeString userPostfix = new CheckAttributeString(iterator.next()); + TestFormat.checkNoReport(userPostfix.isValidUserPostfix(), "Provided empty string for composite node " + + irNode + " at index " + nextIndex); + return userPostfix; + } + + private final CheckAttributeString readUserPostfixForVectorIRNode(String node) { + if (iterator.hasNext()) { + String maybeVectorType = iterator.next(); + if (IRNode.isVectorSize(maybeVectorType)) { + return new CheckAttributeString(maybeVectorType); + } + // If we do not find that pattern, then revert the iterator once + iterator.previous(); + } + return CheckAttributeString.invalid(); + } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java index 2684e14344a..e7db6c4844c 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/checkattribute/parsing/RawIRNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,10 @@ import compiler.lib.ir_framework.CompilePhase; import compiler.lib.ir_framework.IRNode; +import compiler.lib.ir_framework.shared.Comparison; +import compiler.lib.ir_framework.shared.TestFormat; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; +import compiler.lib.ir_framework.driver.SuccessOnlyConstraintException; /** * This class represents a "raw IR node" as read from a check attribute. It has a node part that either represents an @@ -51,14 +55,85 @@ public CompilePhase defaultCompilePhase() { return IRNode.getDefaultPhase(node); } - public String regex(CompilePhase compilePhase) { + public String regex(CompilePhase compilePhase, VMInfo vmInfo, Comparison.Bound bound) { String nodeRegex = node; if (IRNode.isIRNode(node)) { nodeRegex = IRNode.getRegexForCompilePhase(node, compilePhase); - if (userPostfix.isValid()) { + if (IRNode.isVectorIRNode(node)) { + nodeRegex = regexForVectorIRNode(nodeRegex, vmInfo, bound); + } else if (userPostfix.isValid()) { nodeRegex = nodeRegex.replaceAll(IRNode.IS_REPLACED, userPostfix.value()); } } return nodeRegex; } + + private String regexForVectorIRNode(String nodeRegex, VMInfo vmInfo, Comparison.Bound bound) { + String type = IRNode.getVectorNodeType(node); + TestFormat.checkNoReport(IRNode.getTypeSizeInBytes(type) > 0, + "Vector node's type must have valid type, got \"" + type + "\" for \"" + node + "\""); + String size = null; + if (userPostfix.isValid()) { + // Size is explicitly stated + String value = userPostfix.value(); + TestFormat.checkNoReport(value.startsWith(IRNode.VECTOR_SIZE), + "Vector node's vector size must start with IRNode.VECTOR_SIZE, got: \"" + value + "\""); + size = value.substring(2); + + if (!vmInfo.canTrustVectorSize()) { + // Parse it already just to get errors before we overwrite size + IRNode.parseVectorNodeSize(size, type, vmInfo); + } + } + + // Set default values in some cases: + if (!userPostfix.isValid() || !vmInfo.canTrustVectorSize()) { + switch (bound) { + case LOWER -> { + // For lower bound we check for the maximal size by default. But if we cannot trust the + // vector size we at least check there are vectors of any size. + if (vmInfo.canTrustVectorSize()) { + // No size specified, so assume maximal size + size = IRNode.VECTOR_SIZE_TAG_MAX; + } else { + System.out.println("WARNING: you are on a system with \"canTrustVectorSize == false\" (default Cascade Lake)."); + System.out.println(" The lower bound rule for \"" + node + "\" is now performed with"); + System.out.println(" \"IRNode.VECTOR_SIZE_TAG_ANY\" instead of \"IRNode.VECTOR_SIZE_TAG_MAX\"."); + size = IRNode.VECTOR_SIZE_TAG_ANY; + } + } + case UPPER -> { + if (userPostfix.isValid()) { + TestFormat.checkNoReport(!vmInfo.canTrustVectorSize(), "sanity"); + // If we have a size specified but cannot trust the size, and must check an upper + // bound, this can be impossible to count correctly - if we have an incorrect size + // we may count either too many nodes. We just create an impossible regex which will + // always have count zero and make the upper bound rule pass. + System.out.println("WARNING: you are on a system with \"canTrustVectorSize == false\" (default Cascade Lake)."); + System.out.println(" The upper bound rule for \"" + node + "\" cannot be checked."); + throw new SuccessOnlyConstraintException("upper bound with specified size"); + } else { + // For upper bound we check for vectors of any size by default. + size = IRNode.VECTOR_SIZE_TAG_ANY; + } + } + case EQUAL -> { + if (vmInfo.canTrustVectorSize()) { + // No size specified, so assume maximal size + size = IRNode.VECTOR_SIZE_TAG_MAX; + } else { + // Equal comparison to a strictly positive number would lead us to an impossible + // situation: we might have to know the exact vector size or else we count too many + // or too few cases. We therefore skip such a constraint and treat it as success. + System.out.println("WARNING: you are on a system with \"canTrustVectorSize == false\" (default Cascade Lake)."); + System.out.println(" The equal count comparison rule for \"" + node + "\" cannot be checked."); + throw new SuccessOnlyConstraintException("equal count comparison"); + } + } + } + } + String sizeRegex = IRNode.parseVectorNodeSize(size, type, vmInfo); + return nodeRegex.replaceAll(IRNode.IS_REPLACED, + "vector[A-Za-z]\\\\[" + sizeRegex + "\\\\]:\\\\{" + type + "\\\\}"); + } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/Constraint.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/Constraint.java index 42c1b10e518..02a2d5a4918 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/Constraint.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/Constraint.java @@ -61,6 +61,12 @@ public static Constraint createCounts(String nodeRegex, int constraintId, Compar return new Constraint(new CountsConstraintCheck(nodeRegex, constraintId, comparison), nodeRegex, compilationOutput); } + public static Constraint createSuccess() { + String nodeRegex = "impossible_regex"; + String compilationOutput = ""; // empty + return new Constraint(new SuccessConstraintCheck(), nodeRegex, compilationOutput); + } + public String nodeRegex() { return nodeRegex; } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/SuccessConstraintCheck.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/SuccessConstraintCheck.java new file mode 100644 index 00000000000..f74e31828ec --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/SuccessConstraintCheck.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.lib.ir_framework.driver.irmatching.irrule.constraint; + +import compiler.lib.ir_framework.driver.irmatching.MatchResult; + +import java.util.List; + +/** + * This class provides a check that always succeeds. + * + * @see Constraint + */ +class SuccessConstraintCheck implements ConstraintCheck { + + @Override + public MatchResult check(List matchedNodes) { + return SuccessResult.getInstance(); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawConstraint.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawConstraint.java index 03a7f127f3d..1c2fba218db 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawConstraint.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawConstraint.java @@ -27,6 +27,7 @@ import compiler.lib.ir_framework.IR; import compiler.lib.ir_framework.IRNode; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; /** * Interface to represent a single raw constraint as found in the {@link IR @IR} annotation (i.e. {@link IRNode} @@ -38,5 +39,5 @@ */ public interface RawConstraint { CompilePhase defaultCompilePhase(); - Constraint parse(CompilePhase compilePhase, String compilationOutput); + Constraint parse(CompilePhase compilePhase, String compilationOutput, VMInfo vmInfo); } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawCountsConstraint.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawCountsConstraint.java index 76c4a65483c..9934a830a06 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawCountsConstraint.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawCountsConstraint.java @@ -26,10 +26,15 @@ import compiler.lib.ir_framework.CompilePhase; import compiler.lib.ir_framework.IR; +import compiler.lib.ir_framework.IRNode; import compiler.lib.ir_framework.TestFramework; import compiler.lib.ir_framework.driver.irmatching.irrule.checkattribute.parsing.RawIRNode; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; +import compiler.lib.ir_framework.driver.SuccessOnlyConstraintException; import compiler.lib.ir_framework.shared.Comparison; +import compiler.lib.ir_framework.shared.TestFormat; +import compiler.lib.ir_framework.shared.TestFormatException; /** * This class represents a raw constraint of a {@link IR#counts()} attribute. @@ -52,9 +57,49 @@ public CompilePhase defaultCompilePhase() { return rawIRNode.defaultCompilePhase(); } + private Comparison.Bound getComparisonBound() { + switch (comparison.getComparator()) { + case "<" -> { + TestFormat.checkNoReport(comparison.getGivenValue() > 0, "Node count comparison \"<" + + comparison.getGivenValue() + "\" is not allowed: always false."); + TestFormat.checkNoReport(comparison.getGivenValue() > 1, "Node count comparison \"<" + + comparison.getGivenValue() + "\" should be rewritten as \"=0\""); + return Comparison.Bound.UPPER; + } + case "<=" -> { + TestFormat.checkNoReport(comparison.getGivenValue() >= 0, "Node count comparison \"<=" + + comparison.getGivenValue() + "\" is not allowed: always false."); + TestFormat.checkNoReport(comparison.getGivenValue() >= 1, "Node count comparison \"<=" + + comparison.getGivenValue() + "\" should be rewritten as \"=0\""); + return Comparison.Bound.UPPER; + } + case "=" -> { + // "=0" is same as setting upper bound - just like for failOn. But if we compare equals a + // strictly positive number it is like setting both upper and lower bound (equal). + return comparison.getGivenValue() > 0 ? Comparison.Bound.EQUAL : Comparison.Bound.UPPER; + } + case ">" -> { + TestFormat.checkNoReport(comparison.getGivenValue() >= 0, "Node count comparison \">" + + comparison.getGivenValue() + "\" is useless, please only use positive numbers."); + return Comparison.Bound.LOWER; + } + case ">=" -> { + TestFormat.checkNoReport(comparison.getGivenValue() > 0, "Node count comparison \">=" + + comparison.getGivenValue() + "\" is useless, please only use strictly positive numbers with greater-equal."); + return Comparison.Bound.LOWER; + } + case "!=" -> throw new TestFormatException("Not-equal comparator not supported. Please rewrite the rule."); + default -> throw new TestFormatException("Comparator not handled: " + comparison.getComparator()); + } + } + @Override - public Constraint parse(CompilePhase compilePhase, String compilationOutput) { + public Constraint parse(CompilePhase compilePhase, String compilationOutput, VMInfo vmInfo) { TestFramework.check(compilePhase != CompilePhase.DEFAULT, "must not be default"); - return Constraint.createCounts(rawIRNode.regex(compilePhase), constraintIndex, comparison, compilationOutput); + try { + return Constraint.createCounts(rawIRNode.regex(compilePhase, vmInfo, getComparisonBound()), constraintIndex, comparison, compilationOutput); + } catch (SuccessOnlyConstraintException e) { + return Constraint.createSuccess(); + } } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawFailOnConstraint.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawFailOnConstraint.java index 18ec1936273..83d564ba13d 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawFailOnConstraint.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/constraint/raw/RawFailOnConstraint.java @@ -25,9 +25,12 @@ import compiler.lib.ir_framework.CompilePhase; import compiler.lib.ir_framework.IR; +import compiler.lib.ir_framework.IRNode; import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.shared.Comparison; import compiler.lib.ir_framework.driver.irmatching.irrule.checkattribute.parsing.RawIRNode; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; /** * This class represents a raw constraint of a {@link IR#failOn()} attribute. @@ -49,9 +52,9 @@ public CompilePhase defaultCompilePhase() { } @Override - public Constraint parse(CompilePhase compilePhase, String compilationOutput) { + public Constraint parse(CompilePhase compilePhase, String compilationOutput, VMInfo vmInfo) { TestFramework.check(compilePhase != CompilePhase.DEFAULT, "must not be default"); - return Constraint.createFailOn(rawIRNode.regex(compilePhase), constraintIndex, compilationOutput); + return Constraint.createFailOn(rawIRNode.regex(compilePhase, vmInfo, Comparison.Bound.UPPER), constraintIndex, compilationOutput); } } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/CompilePhaseIRRuleBuilder.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/CompilePhaseIRRuleBuilder.java index 7c89ac433a6..5d327135c22 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/CompilePhaseIRRuleBuilder.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/CompilePhaseIRRuleBuilder.java @@ -34,6 +34,7 @@ import compiler.lib.ir_framework.driver.irmatching.irrule.checkattribute.parsing.RawFailOn; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.raw.RawConstraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; import compiler.lib.ir_framework.shared.TestFormat; import java.util.*; @@ -60,24 +61,24 @@ public CompilePhaseIRRuleBuilder(IR irAnno, Compilation compilation) { this.rawCountsConstraints = new RawCounts(irAnno.counts()).createRawConstraints(); } - public SortedSet build() { + public SortedSet build(VMInfo vmInfo) { CompilePhase[] compilePhases = irAnno.phase(); TestFormat.checkNoReport(new HashSet<>(List.of(compilePhases)).size() == compilePhases.length, "Cannot specify a compile phase twice"); for (CompilePhase compilePhase : compilePhases) { if (compilePhase == CompilePhase.DEFAULT) { - createCompilePhaseIRRulesForDefault(); + createCompilePhaseIRRulesForDefault(vmInfo); } else { - createCompilePhaseIRRule(compilePhase); + createCompilePhaseIRRule(compilePhase, vmInfo); } } return compilePhaseIRRules; } - private void createCompilePhaseIRRulesForDefault() { + private void createCompilePhaseIRRulesForDefault(VMInfo vmInfo) { DefaultPhaseRawConstraintParser parser = new DefaultPhaseRawConstraintParser(compilation); Map> checkAttributesForCompilePhase = - parser.parse(rawFailOnConstraints, rawCountsConstraints); + parser.parse(rawFailOnConstraints, rawCountsConstraints, vmInfo); checkAttributesForCompilePhase.forEach((compilePhase, constraints) -> { if (compilation.hasOutput(compilePhase)) { compilePhaseIRRules.add(new CompilePhaseIRRule(compilePhase, constraints, @@ -88,9 +89,9 @@ private void createCompilePhaseIRRulesForDefault() { }); } - private void createCompilePhaseIRRule(CompilePhase compilePhase) { - List failOnConstraints = parseRawConstraints(rawFailOnConstraints, compilePhase); - List countsConstraints = parseRawConstraints(rawCountsConstraints, compilePhase); + private void createCompilePhaseIRRule(CompilePhase compilePhase, VMInfo vmInfo) { + List failOnConstraints = parseRawConstraints(rawFailOnConstraints, compilePhase, vmInfo); + List countsConstraints = parseRawConstraints(rawCountsConstraints, compilePhase, vmInfo); if (compilation.hasOutput(compilePhase)) { createValidCompilePhaseIRRule(compilePhase, failOnConstraints, countsConstraints); } else { @@ -113,10 +114,11 @@ private void createValidCompilePhaseIRRule(CompilePhase compilePhase, List parseRawConstraints(List rawConstraints, - CompilePhase compilePhase) { + CompilePhase compilePhase, + VMInfo vmInfo) { List constraintResultList = new ArrayList<>(); for (RawConstraint rawConstraint : rawConstraints) { - constraintResultList.add(rawConstraint.parse(compilePhase, compilation.output(compilePhase))); + constraintResultList.add(rawConstraint.parse(compilePhase, compilation.output(compilePhase), vmInfo)); } return constraintResultList; } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/DefaultPhaseRawConstraintParser.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/DefaultPhaseRawConstraintParser.java index cf530fb19a2..1f837883978 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/DefaultPhaseRawConstraintParser.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/irrule/phase/DefaultPhaseRawConstraintParser.java @@ -31,6 +31,7 @@ import compiler.lib.ir_framework.driver.irmatching.irrule.checkattribute.FailOn; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.Constraint; import compiler.lib.ir_framework.driver.irmatching.irrule.constraint.raw.RawConstraint; +import compiler.lib.ir_framework.driver.irmatching.parser.VMInfo; import compiler.lib.ir_framework.shared.TestFrameworkException; import java.util.ArrayList; @@ -52,22 +53,26 @@ public DefaultPhaseRawConstraintParser(Compilation compilation) { } public Map> parse(List rawFailOnConstraints, - List rawCountsConstraints) { + List rawCountsConstraints, + VMInfo vmInfo) { Map failOnForCompilePhase = parseRawConstraints(rawFailOnConstraints, - CheckAttributeType.FAIL_ON); + CheckAttributeType.FAIL_ON, + vmInfo); Map countsForCompilePhase = parseRawConstraints(rawCountsConstraints, - CheckAttributeType.COUNTS); + CheckAttributeType.COUNTS, + vmInfo); return mergeCheckAttributesForCompilePhase(failOnForCompilePhase, countsForCompilePhase); } private Map parseRawConstraints(List rawConstraints, - CheckAttributeType checkAttributeType) { + CheckAttributeType checkAttributeType, + VMInfo vmInfo) { Map> matchableForCompilePhase = new HashMap<>(); for (RawConstraint rawConstraint : rawConstraints) { CompilePhase compilePhase = rawConstraint.defaultCompilePhase(); List checkAttribute = matchableForCompilePhase.computeIfAbsent(compilePhase, k -> new ArrayList<>()); - checkAttribute.add(rawConstraint.parse(compilePhase, compilation.output(compilePhase))); + checkAttribute.add(rawConstraint.parse(compilePhase, compilation.output(compilePhase), vmInfo)); } return replaceConstraintsWithCheckAttribute(matchableForCompilePhase, checkAttributeType); } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/IRMethodBuilder.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/IRMethodBuilder.java index fb7db3e3a3b..beed44a01c5 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/IRMethodBuilder.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/IRMethodBuilder.java @@ -51,18 +51,18 @@ public IRMethodBuilder(TestMethods testMethods, LoggedMethods loggedMethods) { * Create IR methods for all test methods identified by {@link IREncodingParser} by combining them with the parsed * compilation output from {@link HotSpotPidFileParser}. */ - public SortedSet build() { + public SortedSet build(VMInfo vmInfo) { SortedSet irMethods = new TreeSet<>(); testMethods.testMethods().forEach( - (methodName, testMethod) -> irMethods.add(createIRMethod(methodName, testMethod))); + (methodName, testMethod) -> irMethods.add(createIRMethod(methodName, testMethod, vmInfo))); return irMethods; } - private IRMethodMatchable createIRMethod(String methodName, TestMethod testMethod) { + private IRMethodMatchable createIRMethod(String methodName, TestMethod testMethod, VMInfo vmInfo) { LoggedMethod loggedMethod = loggedMethods.get(methodName); if (loggedMethod != null) { return new IRMethod(testMethod.method(), testMethod.irRuleIds(), testMethod.irAnnos(), - new Compilation(loggedMethod.compilationOutput())); + new Compilation(loggedMethod.compilationOutput()), vmInfo); } else { return new NotCompiledIRMethod(testMethod.method(), testMethod.irRuleIds().length); } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/TestClassParser.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/TestClassParser.java index ea4b0acf0bb..776642d460c 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/TestClassParser.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/TestClassParser.java @@ -54,10 +54,11 @@ public TestClassParser(Class testClass) { public Matchable parse(String hotspotPidFileName, String irEncoding) { IREncodingParser irEncodingParser = new IREncodingParser(testClass); TestMethods testMethods = irEncodingParser.parse(irEncoding); + VMInfo vmInfo = VMInfoParser.parseVMInfo(irEncoding); if (testMethods.hasTestMethods()) { HotSpotPidFileParser hotSpotPidFileParser = new HotSpotPidFileParser(testClass.getName(), testMethods); LoggedMethods loggedMethods = hotSpotPidFileParser.parse(hotspotPidFileName); - return createTestClass(testMethods, loggedMethods); + return createTestClass(testMethods, loggedMethods, vmInfo); } return new NonIRTestClass(); } @@ -66,9 +67,9 @@ public Matchable parse(String hotspotPidFileName, String irEncoding) { * Create test class with IR methods for all test methods identified by {@link IREncodingParser} by combining them * with the parsed compilation output from {@link HotSpotPidFileParser}. */ - private Matchable createTestClass(TestMethods testMethods, LoggedMethods loggedMethods) { + private Matchable createTestClass(TestMethods testMethods, LoggedMethods loggedMethods, VMInfo vmInfo) { IRMethodBuilder irMethodBuilder = new IRMethodBuilder(testMethods, loggedMethods); - SortedSet irMethods = irMethodBuilder.build(); + SortedSet irMethods = irMethodBuilder.build(vmInfo); TestFormat.throwIfAnyFailures(); return new TestClass(irMethods); } diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfo.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfo.java new file mode 100644 index 00000000000..d76dea902c2 --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfo.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.lib.ir_framework.driver.irmatching.parser; + +import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.shared.TestFrameworkException; + +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * This class stores the key value mapping from the VMInfo. + * + * @see IREncodingParser + */ +public class VMInfo { + /** + * Stores the key-value mapping. + */ + private final Map keyValueMap; + + private static final Pattern CPU_SKYLAKE_PATTERN = + Pattern.compile("family 6 model 85 stepping (\\d) "); + + public VMInfo(Map map) { + this.keyValueMap = map; + + TestFramework.check(isKey("cpuFeatures"), "VMInfo does not contain cpuFeatures"); + TestFramework.check(isKey("MaxVectorSize"), "VMInfo does not contain MaxVectorSize"); + TestFramework.check(isKey("MaxVectorSizeIsDefault"), "VMInfo does not contain MaxVectorSizeIsDefault"); + TestFramework.check(isKey("LoopMaxUnroll"), "VMInfo does not contain LoopMaxUnroll"); + TestFramework.check(isKey("UseAVX"), "VMInfo does not contain UseAVX"); + TestFramework.check(isKey("UseAVXIsDefault"), "VMInfo does not contain UseAVXIsDefault"); + } + + public String getStringValue(String key) { + TestFramework.check(isKey(key), "VMInfo does not contain \"" + key + "\""); + return keyValueMap.get(key); + } + + public long getLongValue(String key) { + try { + return Long.parseLong(getStringValue(key)); + } catch (NumberFormatException e) { + throw new TestFrameworkException("VMInfo value for \"" + key + "\" is not a long, got \"" + getStringValue(key) + "\""); + } + } + + public boolean hasCPUFeature(String feature) { + String features = getStringValue("cpuFeatures") + ","; + return features.contains(" " + feature + ","); + } + + public boolean isCascadeLake() { + Matcher matcher = CPU_SKYLAKE_PATTERN.matcher(getStringValue("cpuFeatures")); + if (!matcher.find()) { + return false; // skylake pattern not found + } + String stepping = matcher.group(1).trim(); + return Long.parseLong(stepping) >= 5; // this makes it Cascade Lake + } + + public boolean isDefaultCascadeLake() { + // See VM_Version::is_default_intel_cascade_lake + return isCascadeLake() && + getLongValue("MaxVectorSizeIsDefault") == 1 && + getLongValue("UseAVXIsDefault") == 1 && + getLongValue("UseAVX") > 2; + } + + /** + * Some platforms do not behave as expected, and one cannot trust that the vectors + * make use of the full MaxVectorSize. For Cascade Lake, we only use 32 bytes for + * SuperWord by default even though MaxVectorSize is 64. But the VectorAPI still + * uses 64 bytes. Thus MaxVectorSize is not a reliable indicator for the expected + * maximal vector size on that platform. + */ + public boolean canTrustVectorSize() { + return !isDefaultCascadeLake(); + } + + public boolean isKey(String key) { + return keyValueMap.containsKey(key); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfoParser.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfoParser.java new file mode 100644 index 00000000000..a8e6782ab12 --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/VMInfoParser.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.lib.ir_framework.driver.irmatching.parser; + +import compiler.lib.ir_framework.TestFramework; +import compiler.lib.ir_framework.shared.TestFrameworkException; +import compiler.lib.ir_framework.test.VMInfoPrinter; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Class to parse the VMInfo emitted by the test VM and creating {@link VMInfo} objects for each entry. + * + * @see VMInfo + */ +public class VMInfoParser { + + private static final Pattern VM_INFO_PATTERN = + Pattern.compile("(?<=" + VMInfoPrinter.START_VM_INFO + "\r?\n).*\\R([\\s\\S]*)(?=" + VMInfoPrinter.END_VM_INFO + ")"); + + /** + * Extract VMInfo from the irEncoding. + */ + public static VMInfo parseVMInfo(String irEncoding) { + Map map = new HashMap<>(); + String[] lines = getVMInfoLines(irEncoding); + for (String s : lines) { + String line = s.trim(); + String[] splitLine = line.split(":", 2); + if (splitLine.length != 2) { + throw new TestFrameworkException("Invalid VMInfo key:value encoding. Found: " + splitLine[0]); + } + String key = splitLine[0]; + String value = splitLine[1]; + map.put(key, value); + } + return new VMInfo(map); + } + + /** + * Extract the VMInfo from the irEncoding string, strip away the header and return the individual key-value lines. + */ + private static String[] getVMInfoLines(String irEncoding) { + Matcher matcher = VM_INFO_PATTERN.matcher(irEncoding); + TestFramework.check(matcher.find(), "Did not find VMInfo in:" + System.lineSeparator() + irEncoding); + String lines = matcher.group(1).trim(); + if (lines.isEmpty()) { + // Nothing to IR match. + return new String[0]; + } + return lines.split("\\R"); + } +} diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/shared/Comparison.java b/test/hotspot/jtreg/compiler/lib/ir_framework/shared/Comparison.java index d9e124a2efd..fc553212e4d 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/shared/Comparison.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/shared/Comparison.java @@ -38,6 +38,12 @@ public class Comparison> { private final BiPredicate comparisonPredicate; private final String comparator; + public enum Bound { + LOWER, + UPPER, + EQUAL, + } + public Comparison(T givenValue, String comparator, BiPredicate comparisonPredicate) { this.givenValue = givenValue; this.comparator = comparator; diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java index 697f97ea1bc..be65bd6e207 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java @@ -266,6 +266,7 @@ private void setupTests() { addBaseTests(); if (PRINT_VALID_IR_RULES) { irMatchRulePrinter.emit(); + VMInfoPrinter.emit(); } TestFormat.throwIfAnyFailures(); declaredTests.clear(); diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java new file mode 100644 index 00000000000..14636da4cbe --- /dev/null +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/VMInfoPrinter.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.lib.ir_framework.test; + +import compiler.lib.ir_framework.shared.TestFrameworkSocket; +import jdk.test.whitebox.WhiteBox; + +/** + * Prints some test VM info to the socket. + */ +public class VMInfoPrinter { + public static final String START_VM_INFO = "##### IRMatchingVMInfo - used by TestFramework #####"; + public static final String END_VM_INFO = "----- END VMInfo -----"; + + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + + public static void emit() { + StringBuilder vmInfo = new StringBuilder(); + vmInfo.append(START_VM_INFO).append(System.lineSeparator()); + vmInfo.append(":").append(System.lineSeparator()); + + // CPU feature independent info + String cpuFeatures = WHITE_BOX.getCPUFeatures(); + vmInfo.append("cpuFeatures:").append(cpuFeatures).append(System.lineSeparator()); + long maxVectorSize = WHITE_BOX.getIntxVMFlag("MaxVectorSize"); + vmInfo.append("MaxVectorSize:").append(maxVectorSize).append(System.lineSeparator()); + boolean maxVectorSizeIsDefault = WHITE_BOX.isDefaultVMFlag("MaxVectorSize"); + vmInfo.append("MaxVectorSizeIsDefault:") + .append(maxVectorSizeIsDefault ? 1 : 0) + .append(System.lineSeparator()); + long loopMaxUnroll = WHITE_BOX.getIntxVMFlag("LoopMaxUnroll"); + vmInfo.append("LoopMaxUnroll:").append(loopMaxUnroll).append(System.lineSeparator()); + + // CPU feature dependent info + long useAVX = 0; + boolean useAVXIsDefault = true; + if (cpuFeatures.contains(" sse, ")) { + useAVX = WHITE_BOX.getIntVMFlag("UseAVX"); + useAVXIsDefault = WHITE_BOX.isDefaultVMFlag("UseAVX"); + } + vmInfo.append("UseAVX:").append(useAVX).append(System.lineSeparator()); + vmInfo.append("UseAVXIsDefault:") + .append(useAVXIsDefault ? 1 : 0) + .append(System.lineSeparator()); + + vmInfo.append(END_VM_INFO); + TestFrameworkSocket.write(vmInfo.toString(), "VMInfo"); + } +} diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Double.java b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Double.java index 32c1053e6dc..0122f1c34cd 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Double.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Double.java @@ -92,7 +92,7 @@ public static void sumReductionInit( (with or without store) in SuperWord::profitable. */ @Test @IR(applyIf = {"SuperWordReductions", "false"}, - failOn = {IRNode.ADD_REDUCTION_VD, IRNode.ABS_V, IRNode.NEG_V}) + failOn = {IRNode.ADD_REDUCTION_VD, IRNode.ABS_VD, IRNode.NEG_VD}) public static double sumReductionImplement( double[] a, double[] b, diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Float.java b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Float.java index f3eb427e0ea..f886daf903f 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Float.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedAbsNeg_Float.java @@ -90,10 +90,12 @@ public static void sumReductionInit( @Test @IR(applyIf = {"SuperWordReductions", "false"}, - failOn = {IRNode.ADD_REDUCTION_VF, IRNode.ABS_V, IRNode.NEG_V}) + failOn = {IRNode.ADD_REDUCTION_VF, IRNode.ABS_VF, IRNode.NEG_VF}) @IR(applyIfCPUFeature = {"sse2", "true"}, applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"}, - counts = {IRNode.ADD_REDUCTION_VF, ">= 1", IRNode.ABS_V, ">= 1", IRNode.NEG_V, ">= 1"}) + counts = {IRNode.ADD_REDUCTION_VF, ">= 1", + IRNode.ABS_VF, IRNode.VECTOR_SIZE + "min(LoopMaxUnroll, max_float)", ">= 1", + IRNode.NEG_VF, IRNode.VECTOR_SIZE + "min(LoopMaxUnroll, max_float)", ">= 1"}) public static float sumReductionImplement( float[] a, float[] b, diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedSqrt_Double.java b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedSqrt_Double.java index 76453b21e84..d0fd27d25b4 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/SumRedSqrt_Double.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/SumRedSqrt_Double.java @@ -87,10 +87,10 @@ public static void sumReductionInit( Require avx for SQRT_VD. */ @Test @IR(applyIf = {"SuperWordReductions", "false"}, - failOn = {IRNode.ADD_REDUCTION_VD, IRNode.SQRT_V}) + failOn = {IRNode.ADD_REDUCTION_VD, IRNode.SQRT_VD}) @IR(applyIfCPUFeature = {"avx", "true"}, applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"}, - counts = {IRNode.ADD_REDUCTION_VD, ">= 1", IRNode.SQRT_V, ">= 1"}) + counts = {IRNode.ADD_REDUCTION_VD, ">= 1", IRNode.SQRT_VD, ">= 1"}) public static double sumReductionWithStoreImplement( double[] a, double[] b, diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java index 803c7e9841d..94e47f3f747 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java @@ -240,7 +240,7 @@ public void runTest9() { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test0(int[] dataI, float[] dataF) { for (int i = 0; i < RANGE; i++) { @@ -346,7 +346,7 @@ static void test7(int[] dataI, float[] dataF) { } @Test - @IR(counts = {IRNode.ADD_VF, "> 0"}, + @IR(counts = {IRNode.ADD_VF, IRNode.VECTOR_SIZE + "min(max_int, max_float)", "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) // Some aarch64 machines have AlignVector == true, like ThunderX2 diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestDependencyOffsets.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestDependencyOffsets.java index 14033f9712a..132844801a1 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestDependencyOffsets.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestDependencyOffsets.java @@ -27,7 +27,7 @@ * and various MaxVectorSize values, and +- AlignVector. * * Note: this test is auto-generated. Please modify / generate with script: - * https://bugs.openjdk.org/browse/JDK-8308606 + * https://bugs.openjdk.org/browse/JDK-8310308 * * Types: int, long, short, char, byte, float, double * Offsets: 0, -1, 1, -2, 2, -3, 3, -4, 4, -7, 7, -8, 8, -14, 14, -16, 16, -18, 18, -20, 20, -31, 31, -32, 32, -63, 63, -64, 64, -65, 65, -128, 128, -129, 129, -192, 192 @@ -1389,19 +1389,19 @@ public static void main(String args[]) { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP0(int[] data) { @@ -1421,35 +1421,35 @@ public static void runIntP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM1(int[] data) { @@ -1497,19 +1497,19 @@ public static void runIntP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM2(int[] data) { @@ -1530,22 +1530,22 @@ public static void runIntM2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP2(int[] data) { @@ -1565,35 +1565,35 @@ public static void runIntP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM3(int[] data) { @@ -1614,22 +1614,22 @@ public static void runIntM3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP3(int[] data) { @@ -1649,19 +1649,19 @@ public static void runIntP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM4(int[] data) { @@ -1681,26 +1681,26 @@ public static void runIntM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP4(int[] data) { @@ -1720,35 +1720,35 @@ public static void runIntP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM7(int[] data) { @@ -1768,22 +1768,22 @@ public static void runIntM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP7(int[] data) { @@ -1803,19 +1803,19 @@ public static void runIntP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM8(int[] data) { @@ -1835,32 +1835,32 @@ public static void runIntM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP8(int[] data) { @@ -1880,19 +1880,19 @@ public static void runIntP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM14(int[] data) { @@ -1912,20 +1912,20 @@ public static void runIntM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 56 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 56"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP14(int[] data) { @@ -1945,19 +1945,19 @@ public static void runIntP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM16(int[] data) { @@ -1977,35 +1977,35 @@ public static void runIntM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP16(int[] data) { @@ -2025,19 +2025,19 @@ public static void runIntP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM18(int[] data) { @@ -2057,19 +2057,19 @@ public static void runIntM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP18(int[] data) { @@ -2089,19 +2089,19 @@ public static void runIntP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM20(int[] data) { @@ -2121,23 +2121,23 @@ public static void runIntM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP20(int[] data) { @@ -2157,35 +2157,35 @@ public static void runIntP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM31(int[] data) { @@ -2205,19 +2205,19 @@ public static void runIntM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP31(int[] data) { @@ -2237,19 +2237,19 @@ public static void runIntP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM32(int[] data) { @@ -2269,35 +2269,35 @@ public static void runIntM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP32(int[] data) { @@ -2317,35 +2317,35 @@ public static void runIntP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM63(int[] data) { @@ -2365,19 +2365,19 @@ public static void runIntM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP63(int[] data) { @@ -2397,19 +2397,19 @@ public static void runIntP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM64(int[] data) { @@ -2429,35 +2429,35 @@ public static void runIntM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP64(int[] data) { @@ -2477,35 +2477,35 @@ public static void runIntP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM65(int[] data) { @@ -2525,19 +2525,19 @@ public static void runIntM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP65(int[] data) { @@ -2557,19 +2557,19 @@ public static void runIntP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM128(int[] data) { @@ -2589,35 +2589,35 @@ public static void runIntM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP128(int[] data) { @@ -2637,35 +2637,35 @@ public static void runIntP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_I, IRNode.MUL_VI, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM129(int[] data) { @@ -2685,19 +2685,19 @@ public static void runIntM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP129(int[] data) { @@ -2717,19 +2717,19 @@ public static void runIntP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntM192(int[] data) { @@ -2749,35 +2749,35 @@ public static void runIntM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testIntP192(int[] data) { @@ -2797,19 +2797,19 @@ public static void runIntP192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP0(long[] data) { @@ -2829,35 +2829,35 @@ public static void runLongP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM1(long[] data) { @@ -2905,19 +2905,19 @@ public static void runLongP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM2(long[] data) { @@ -2937,26 +2937,26 @@ public static void runLongM2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP2(long[] data) { @@ -2976,35 +2976,35 @@ public static void runLongP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM3(long[] data) { @@ -3024,22 +3024,22 @@ public static void runLongM3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP3(long[] data) { @@ -3059,19 +3059,19 @@ public static void runLongP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM4(long[] data) { @@ -3091,32 +3091,32 @@ public static void runLongM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP4(long[] data) { @@ -3136,35 +3136,35 @@ public static void runLongP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM7(long[] data) { @@ -3184,20 +3184,20 @@ public static void runLongM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 56 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 56"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP7(long[] data) { @@ -3217,19 +3217,19 @@ public static void runLongP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM8(long[] data) { @@ -3249,35 +3249,35 @@ public static void runLongM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP8(long[] data) { @@ -3297,19 +3297,19 @@ public static void runLongP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM14(long[] data) { @@ -3329,23 +3329,23 @@ public static void runLongM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP14(long[] data) { @@ -3365,19 +3365,19 @@ public static void runLongP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM16(long[] data) { @@ -3397,35 +3397,35 @@ public static void runLongM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP16(long[] data) { @@ -3445,19 +3445,19 @@ public static void runLongP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM18(long[] data) { @@ -3477,23 +3477,23 @@ public static void runLongM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP18(long[] data) { @@ -3513,19 +3513,19 @@ public static void runLongP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM20(long[] data) { @@ -3545,31 +3545,31 @@ public static void runLongM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP20(long[] data) { @@ -3589,35 +3589,35 @@ public static void runLongP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM31(long[] data) { @@ -3637,19 +3637,19 @@ public static void runLongM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP31(long[] data) { @@ -3669,19 +3669,19 @@ public static void runLongP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM32(long[] data) { @@ -3701,35 +3701,35 @@ public static void runLongM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP32(long[] data) { @@ -3749,35 +3749,35 @@ public static void runLongP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM63(long[] data) { @@ -3797,19 +3797,19 @@ public static void runLongM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP63(long[] data) { @@ -3829,19 +3829,19 @@ public static void runLongP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM64(long[] data) { @@ -3861,35 +3861,35 @@ public static void runLongM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP64(long[] data) { @@ -3909,35 +3909,35 @@ public static void runLongP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM65(long[] data) { @@ -3957,19 +3957,19 @@ public static void runLongM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP65(long[] data) { @@ -3989,19 +3989,19 @@ public static void runLongP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM128(long[] data) { @@ -4021,35 +4021,35 @@ public static void runLongM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP128(long[] data) { @@ -4069,35 +4069,35 @@ public static void runLongP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.ADD_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_L, IRNode.ADD_VL, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM129(long[] data) { @@ -4117,19 +4117,19 @@ public static void runLongM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP129(long[] data) { @@ -4149,19 +4149,19 @@ public static void runLongP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongM192(long[] data) { @@ -4181,35 +4181,35 @@ public static void runLongM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testLongP192(long[] data) { @@ -4229,19 +4229,19 @@ public static void runLongP192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP0(short[] data) { @@ -4261,35 +4261,35 @@ public static void runShortP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM1(short[] data) { @@ -4337,19 +4337,19 @@ public static void runShortP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM2(short[] data) { @@ -4370,22 +4370,22 @@ public static void runShortM2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP2(short[] data) { @@ -4405,35 +4405,35 @@ public static void runShortP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM3(short[] data) { @@ -4454,22 +4454,22 @@ public static void runShortM3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP3(short[] data) { @@ -4489,19 +4489,19 @@ public static void runShortP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM4(short[] data) { @@ -4522,22 +4522,22 @@ public static void runShortM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP4(short[] data) { @@ -4557,35 +4557,35 @@ public static void runShortP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM7(short[] data) { @@ -4606,22 +4606,22 @@ public static void runShortM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP7(short[] data) { @@ -4641,19 +4641,19 @@ public static void runShortP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM8(short[] data) { @@ -4673,26 +4673,26 @@ public static void runShortM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP8(short[] data) { @@ -4712,19 +4712,19 @@ public static void runShortP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM14(short[] data) { @@ -4744,22 +4744,22 @@ public static void runShortM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP14(short[] data) { @@ -4779,19 +4779,19 @@ public static void runShortP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM16(short[] data) { @@ -4811,32 +4811,32 @@ public static void runShortM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP16(short[] data) { @@ -4856,19 +4856,19 @@ public static void runShortP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM18(short[] data) { @@ -4888,20 +4888,20 @@ public static void runShortM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 36 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 36"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP18(short[] data) { @@ -4921,19 +4921,19 @@ public static void runShortP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM20(short[] data) { @@ -4953,20 +4953,20 @@ public static void runShortM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 40 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 40"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP20(short[] data) { @@ -4986,35 +4986,35 @@ public static void runShortP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM31(short[] data) { @@ -5034,20 +5034,20 @@ public static void runShortM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 62 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 62"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP31(short[] data) { @@ -5067,19 +5067,19 @@ public static void runShortP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM32(short[] data) { @@ -5099,35 +5099,35 @@ public static void runShortM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP32(short[] data) { @@ -5147,35 +5147,35 @@ public static void runShortP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM63(short[] data) { @@ -5195,19 +5195,19 @@ public static void runShortM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP63(short[] data) { @@ -5227,19 +5227,19 @@ public static void runShortP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM64(short[] data) { @@ -5259,35 +5259,35 @@ public static void runShortM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP64(short[] data) { @@ -5307,35 +5307,35 @@ public static void runShortP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM65(short[] data) { @@ -5355,19 +5355,19 @@ public static void runShortM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP65(short[] data) { @@ -5387,19 +5387,19 @@ public static void runShortP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM128(short[] data) { @@ -5419,35 +5419,35 @@ public static void runShortM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP128(short[] data) { @@ -5467,35 +5467,35 @@ public static void runShortP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_S, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM129(short[] data) { @@ -5515,19 +5515,19 @@ public static void runShortM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP129(short[] data) { @@ -5547,19 +5547,19 @@ public static void runShortP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortM192(short[] data) { @@ -5579,35 +5579,35 @@ public static void runShortM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testShortP192(short[] data) { @@ -5627,19 +5627,19 @@ public static void runShortP192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP0(char[] data) { @@ -5659,35 +5659,35 @@ public static void runCharP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM1(char[] data) { @@ -5735,19 +5735,19 @@ public static void runCharP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM2(char[] data) { @@ -5768,22 +5768,22 @@ public static void runCharM2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP2(char[] data) { @@ -5803,35 +5803,35 @@ public static void runCharP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM3(char[] data) { @@ -5852,22 +5852,22 @@ public static void runCharM3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 6 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 6"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP3(char[] data) { @@ -5887,19 +5887,19 @@ public static void runCharP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM4(char[] data) { @@ -5920,22 +5920,22 @@ public static void runCharM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP4(char[] data) { @@ -5955,35 +5955,35 @@ public static void runCharP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM7(char[] data) { @@ -6004,22 +6004,22 @@ public static void runCharM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP7(char[] data) { @@ -6039,19 +6039,19 @@ public static void runCharP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM8(char[] data) { @@ -6071,26 +6071,26 @@ public static void runCharM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP8(char[] data) { @@ -6110,19 +6110,19 @@ public static void runCharP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM14(char[] data) { @@ -6142,22 +6142,22 @@ public static void runCharM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP14(char[] data) { @@ -6177,19 +6177,19 @@ public static void runCharP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM16(char[] data) { @@ -6209,32 +6209,32 @@ public static void runCharM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP16(char[] data) { @@ -6254,19 +6254,19 @@ public static void runCharP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM18(char[] data) { @@ -6286,20 +6286,20 @@ public static void runCharM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 36 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 36"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP18(char[] data) { @@ -6319,19 +6319,19 @@ public static void runCharP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM20(char[] data) { @@ -6351,20 +6351,20 @@ public static void runCharM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 40 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 40"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP20(char[] data) { @@ -6384,35 +6384,35 @@ public static void runCharP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM31(char[] data) { @@ -6432,20 +6432,20 @@ public static void runCharM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 // positive byte_offset 62 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 62"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP31(char[] data) { @@ -6465,19 +6465,19 @@ public static void runCharP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM32(char[] data) { @@ -6497,35 +6497,35 @@ public static void runCharM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP32(char[] data) { @@ -6545,35 +6545,35 @@ public static void runCharP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM63(char[] data) { @@ -6593,19 +6593,19 @@ public static void runCharM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP63(char[] data) { @@ -6625,19 +6625,19 @@ public static void runCharP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM64(char[] data) { @@ -6657,35 +6657,35 @@ public static void runCharM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP64(char[] data) { @@ -6705,35 +6705,35 @@ public static void runCharP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM65(char[] data) { @@ -6753,19 +6753,19 @@ public static void runCharM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP65(char[] data) { @@ -6785,19 +6785,19 @@ public static void runCharP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM128(char[] data) { @@ -6817,35 +6817,35 @@ public static void runCharM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP128(char[] data) { @@ -6865,35 +6865,35 @@ public static void runCharP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_C, IRNode.MUL_VS, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM129(char[] data) { @@ -6913,19 +6913,19 @@ public static void runCharM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP129(char[] data) { @@ -6945,19 +6945,19 @@ public static void runCharP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharM192(char[] data) { @@ -6977,35 +6977,35 @@ public static void runCharM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.MUL_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testCharP192(char[] data) { @@ -7025,19 +7025,19 @@ public static void runCharP192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP0(byte[] data) { @@ -7057,35 +7057,35 @@ public static void runByteP0() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM1(byte[] data) { @@ -7133,35 +7133,35 @@ public static void runByteP1() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM2(byte[] data) { @@ -7209,35 +7209,35 @@ public static void runByteP2() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM3(byte[] data) { @@ -7285,19 +7285,19 @@ public static void runByteP3() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM4(byte[] data) { @@ -7318,22 +7318,22 @@ public static void runByteM4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 4 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP4(byte[] data) { @@ -7353,35 +7353,35 @@ public static void runByteP4() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM7(byte[] data) { @@ -7402,22 +7402,22 @@ public static void runByteM7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 // positive byte_offset 7 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 7"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 7 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 7"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 7 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 7"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 7 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 7"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP7(byte[] data) { @@ -7437,19 +7437,19 @@ public static void runByteP7() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM8(byte[] data) { @@ -7470,22 +7470,22 @@ public static void runByteM8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP8(byte[] data) { @@ -7505,35 +7505,35 @@ public static void runByteP8() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM14(byte[] data) { @@ -7554,22 +7554,22 @@ public static void runByteM14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 14 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 14"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP14(byte[] data) { @@ -7589,19 +7589,19 @@ public static void runByteP14() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM16(byte[] data) { @@ -7621,26 +7621,26 @@ public static void runByteM16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP16(byte[] data) { @@ -7660,35 +7660,35 @@ public static void runByteP16() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM18(byte[] data) { @@ -7708,22 +7708,22 @@ public static void runByteM18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 18 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 18"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 18 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 18"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 18 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 18"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP18(byte[] data) { @@ -7743,19 +7743,19 @@ public static void runByteP18() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM20(byte[] data) { @@ -7775,22 +7775,22 @@ public static void runByteM20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 20 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 20"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 20 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 20"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 20 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 20"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP20(byte[] data) { @@ -7810,35 +7810,35 @@ public static void runByteP20() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM31(byte[] data) { @@ -7858,22 +7858,22 @@ public static void runByteM31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 31 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 31"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 31 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 31"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 // positive byte_offset 31 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 31"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP31(byte[] data) { @@ -7893,19 +7893,19 @@ public static void runByteP31() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM32(byte[] data) { @@ -7925,32 +7925,32 @@ public static void runByteM32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP32(byte[] data) { @@ -7970,35 +7970,35 @@ public static void runByteP32() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM63(byte[] data) { @@ -8018,20 +8018,20 @@ public static void runByteM63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 // positive byte_offset 63 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4", "MaxVectorSize", "<= 63"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP63(byte[] data) { @@ -8051,19 +8051,19 @@ public static void runByteP63() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM64(byte[] data) { @@ -8083,35 +8083,35 @@ public static void runByteM64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP64(byte[] data) { @@ -8131,35 +8131,35 @@ public static void runByteP64() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM65(byte[] data) { @@ -8179,19 +8179,19 @@ public static void runByteM65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP65(byte[] data) { @@ -8211,19 +8211,19 @@ public static void runByteP65() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM128(byte[] data) { @@ -8243,35 +8243,35 @@ public static void runByteM128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP128(byte[] data) { @@ -8291,35 +8291,35 @@ public static void runByteP128() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_B, IRNode.MUL_VB, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM129(byte[] data) { @@ -8339,19 +8339,19 @@ public static void runByteM129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP129(byte[] data) { @@ -8371,19 +8371,19 @@ public static void runByteP129() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteM192(byte[] data) { @@ -8403,35 +8403,35 @@ public static void runByteM192() { @Test // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"}) // CPU: avx2 to avx512 without avx512bw -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"}) // CPU: avx512bw -> vector_width: 64 -> elements in vector: 64 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"avx512bw", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 32 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.MUL_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 4"}, applyIfCPUFeature = {"asimd", "true"}) public static void testByteP192(byte[] data) { @@ -8451,19 +8451,19 @@ public static void runByteP192() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP0(float[] data) { @@ -8483,35 +8483,35 @@ public static void runFloatP0() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM1(float[] data) { @@ -8559,19 +8559,19 @@ public static void runFloatP1() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM2(float[] data) { @@ -8592,22 +8592,22 @@ public static void runFloatM2() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 8 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP2(float[] data) { @@ -8627,35 +8627,35 @@ public static void runFloatP2() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM3(float[] data) { @@ -8676,22 +8676,22 @@ public static void runFloatM3() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 12 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 12"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP3(float[] data) { @@ -8711,19 +8711,19 @@ public static void runFloatP3() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM4(float[] data) { @@ -8743,26 +8743,26 @@ public static void runFloatM4() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP4(float[] data) { @@ -8782,35 +8782,35 @@ public static void runFloatP4() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM7(float[] data) { @@ -8830,22 +8830,22 @@ public static void runFloatM7() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 // positive byte_offset 28 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 28"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP7(float[] data) { @@ -8865,19 +8865,19 @@ public static void runFloatP7() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM8(float[] data) { @@ -8897,32 +8897,32 @@ public static void runFloatM8() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP8(float[] data) { @@ -8942,19 +8942,19 @@ public static void runFloatP8() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM14(float[] data) { @@ -8974,20 +8974,20 @@ public static void runFloatM14() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 // positive byte_offset 56 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8", "MaxVectorSize", "<= 56"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP14(float[] data) { @@ -9007,19 +9007,19 @@ public static void runFloatP14() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM16(float[] data) { @@ -9039,35 +9039,35 @@ public static void runFloatM16() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP16(float[] data) { @@ -9087,19 +9087,19 @@ public static void runFloatP16() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM18(float[] data) { @@ -9119,19 +9119,19 @@ public static void runFloatM18() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP18(float[] data) { @@ -9151,19 +9151,19 @@ public static void runFloatP18() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM20(float[] data) { @@ -9183,23 +9183,23 @@ public static void runFloatM20() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP20(float[] data) { @@ -9219,35 +9219,35 @@ public static void runFloatP20() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM31(float[] data) { @@ -9267,19 +9267,19 @@ public static void runFloatM31() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP31(float[] data) { @@ -9299,19 +9299,19 @@ public static void runFloatP31() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM32(float[] data) { @@ -9331,35 +9331,35 @@ public static void runFloatM32() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP32(float[] data) { @@ -9379,35 +9379,35 @@ public static void runFloatP32() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM63(float[] data) { @@ -9427,19 +9427,19 @@ public static void runFloatM63() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP63(float[] data) { @@ -9459,19 +9459,19 @@ public static void runFloatP63() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM64(float[] data) { @@ -9491,35 +9491,35 @@ public static void runFloatM64() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP64(float[] data) { @@ -9539,35 +9539,35 @@ public static void runFloatP64() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM65(float[] data) { @@ -9587,19 +9587,19 @@ public static void runFloatM65() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP65(float[] data) { @@ -9619,19 +9619,19 @@ public static void runFloatP65() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM128(float[] data) { @@ -9651,35 +9651,35 @@ public static void runFloatM128() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP128(float[] data) { @@ -9699,35 +9699,35 @@ public static void runFloatP128() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.MUL_VF, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM129(float[] data) { @@ -9747,19 +9747,19 @@ public static void runFloatM129() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP129(float[] data) { @@ -9779,19 +9779,19 @@ public static void runFloatP129() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatM192(float[] data) { @@ -9811,35 +9811,35 @@ public static void runFloatM192() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 16 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.MUL_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 8"}, applyIfCPUFeature = {"asimd", "true"}) public static void testFloatP192(float[] data) { @@ -9859,19 +9859,19 @@ public static void runFloatP192() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP0(double[] data) { @@ -9891,35 +9891,35 @@ public static void runDoubleP0() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM1(double[] data) { @@ -9967,19 +9967,19 @@ public static void runDoubleP1() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM2(double[] data) { @@ -9999,26 +9999,26 @@ public static void runDoubleM2() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 16 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP2(double[] data) { @@ -10038,35 +10038,35 @@ public static void runDoubleP2() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM3(double[] data) { @@ -10086,22 +10086,22 @@ public static void runDoubleM3() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 // positive byte_offset 24 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 24"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP3(double[] data) { @@ -10121,19 +10121,19 @@ public static void runDoubleP3() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM4(double[] data) { @@ -10153,32 +10153,32 @@ public static void runDoubleM4() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 32 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 32"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP4(double[] data) { @@ -10198,35 +10198,35 @@ public static void runDoubleP4() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM7(double[] data) { @@ -10246,20 +10246,20 @@ public static void runDoubleM7() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 // positive byte_offset 56 can lead to cyclic dependency - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16", "MaxVectorSize", "<= 56"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP7(double[] data) { @@ -10279,19 +10279,19 @@ public static void runDoubleP7() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM8(double[] data) { @@ -10311,35 +10311,35 @@ public static void runDoubleM8() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP8(double[] data) { @@ -10359,19 +10359,19 @@ public static void runDoubleP8() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM14(double[] data) { @@ -10391,23 +10391,23 @@ public static void runDoubleM14() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP14(double[] data) { @@ -10427,19 +10427,19 @@ public static void runDoubleP14() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM16(double[] data) { @@ -10459,35 +10459,35 @@ public static void runDoubleM16() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP16(double[] data) { @@ -10507,19 +10507,19 @@ public static void runDoubleP16() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM18(double[] data) { @@ -10539,23 +10539,23 @@ public static void runDoubleM18() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP18(double[] data) { @@ -10575,19 +10575,19 @@ public static void runDoubleP18() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM20(double[] data) { @@ -10607,31 +10607,31 @@ public static void runDoubleM20() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP20(double[] data) { @@ -10651,35 +10651,35 @@ public static void runDoubleP20() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM31(double[] data) { @@ -10699,19 +10699,19 @@ public static void runDoubleM31() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP31(double[] data) { @@ -10731,19 +10731,19 @@ public static void runDoubleP31() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM32(double[] data) { @@ -10763,35 +10763,35 @@ public static void runDoubleM32() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP32(double[] data) { @@ -10811,35 +10811,35 @@ public static void runDoubleP32() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM63(double[] data) { @@ -10859,19 +10859,19 @@ public static void runDoubleM63() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP63(double[] data) { @@ -10891,19 +10891,19 @@ public static void runDoubleP63() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM64(double[] data) { @@ -10923,35 +10923,35 @@ public static void runDoubleM64() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP64(double[] data) { @@ -10971,35 +10971,35 @@ public static void runDoubleP64() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM65(double[] data) { @@ -11019,19 +11019,19 @@ public static void runDoubleM65() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP65(double[] data) { @@ -11051,19 +11051,19 @@ public static void runDoubleP65() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM128(double[] data) { @@ -11083,35 +11083,35 @@ public static void runDoubleM128() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP128(double[] data) { @@ -11131,35 +11131,35 @@ public static void runDoubleP128() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Strict alignment not possible. - @IR(failOn = {IRNode.LOAD_VECTOR, IRNode.MUL_V, IRNode.STORE_VECTOR}, + @IR(failOn = {IRNode.LOAD_VECTOR_D, IRNode.MUL_VD, IRNode.STORE_VECTOR}, applyIf = {"AlignVector", "true"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM129(double[] data) { @@ -11179,19 +11179,19 @@ public static void runDoubleM129() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP129(double[] data) { @@ -11211,19 +11211,19 @@ public static void runDoubleP129() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleM192(double[] data) { @@ -11243,35 +11243,35 @@ public static void runDoubleM192() { @Test // CPU: sse4.1 -> vector_width: 16 -> elements in vector: 2 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"}) // CPU: avx and avx2 -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"}) // CPU: avx512 -> vector_width: 64 -> elements in vector: 8 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"avx512", "true"}) // CPU: asimd -> vector_width: 32 -> elements in vector: 4 - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) // Vectorize when strict alignment guaranteed. - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.MUL_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.MUL_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIfAnd = {"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfCPUFeature = {"asimd", "true"}) public static void testDoubleP192(double[] data) { diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java index c384253d6e6..b2748348036 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java @@ -143,7 +143,7 @@ public void runTest1() { } @Test - @IR(counts = {IRNode.ADD_VI, "> 0", IRNode.MUL_VF, "> 0", IRNode.VECTOR_CAST_F2X, "> 0", IRNode.VECTOR_CAST_I2X, "> 0"}, + @IR(counts = {IRNode.ADD_VI, "> 0", IRNode.MUL_VF, "> 0", IRNode.VECTOR_CAST_F2I, "> 0", IRNode.VECTOR_CAST_I2F, "> 0"}, applyIfCPUFeatureOr = {"avx2", "true", "asimd", "true"}) static void test1(int[] dataIa, int[] dataIb, float[] dataFa, float[] dataFb) { for (int i = 0; i < RANGE; i+=2) { diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java index 7fb11d1f808..18f3b6930ea 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java @@ -75,7 +75,7 @@ public void runTests() throws Exception { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.ADD_VI, "= 0", IRNode.ADD_REDUCTION_VI, "> 0"}, // count can be high applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) @@ -114,7 +114,7 @@ static int ref1(int[] data, int sum) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.ADD_REDUCTION_VI, "> 0", IRNode.ADD_REDUCTION_VI, "<= 2"}, // count must be low @@ -149,7 +149,7 @@ static int ref2(int[] data, int sum) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.MUL_VI, "> 0", IRNode.ADD_VI, "= 0", // reduction not moved out of loop IRNode.ADD_REDUCTION_VI, "> 0",}, diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java index 9d851a3688b..431bbe9ac4f 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java @@ -59,8 +59,9 @@ public void runTests() throws Exception { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", - IRNode.OR_REDUCTION_V, "> 0",}, + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_long)", "> 0", + IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE + "min(max_int, max_long)", "> 0", + IRNode.OR_REDUCTION_V, "> 0",}, applyIfCPUFeatureOr = {"avx2", "true"}) static long test1(int[] data, long sum) { for (int i = 0; i < data.length; i++) { @@ -75,7 +76,7 @@ static long test1(int[] data, long sum) { // PhaseIdealLoop::move_unordered_reduction_out_of_loop int v = data[i]; // int read data[0] = 0; // ruin the first pack - sum |= v; // long reduction + sum |= v; // long reduction (and implicit cast from int to long) } return sum; } diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestMaskedMacroLogicVector.java b/test/hotspot/jtreg/compiler/vectorapi/TestMaskedMacroLogicVector.java index a213d481799..69473ff72b3 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestMaskedMacroLogicVector.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestMaskedMacroLogicVector.java @@ -280,17 +280,23 @@ public void testInt4Kernel(VectorSpecies SPECIES, int[] r, int[] a, int[] b, int } @Test - @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, counts = {IRNode.AND_V, " > 0 ", IRNode.XOR_V, " > 0 "}) + @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, + counts = {IRNode.AND_VI, IRNode.VECTOR_SIZE_4, " > 0 ", + IRNode.XOR_VI, IRNode.VECTOR_SIZE_4, " > 0 "}) public void testInt4_Int128(int[] r, int[] a, int[] b, int[] c, boolean [] mask) { testInt4Kernel(IntVector.SPECIES_128, r, a, b, c, mask); } @Test - @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, counts = {IRNode.AND_V, " > 0 ", IRNode.XOR_V, " > 0 "}) + @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, + counts = {IRNode.AND_VI, IRNode.VECTOR_SIZE_8, " > 0 ", + IRNode.XOR_VI, IRNode.VECTOR_SIZE_8, " > 0 "}) public void testInt4_Int256(int[] r, int[] a, int[] b, int[] c, boolean [] mask) { testInt4Kernel(IntVector.SPECIES_256, r, a, b, c, mask); } @Test - @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, counts = {IRNode.AND_V, " > 0 ", IRNode.XOR_V, " > 0 "}) + @IR(applyIfAnd = {"UseAVX", "3", "UseSSE", " > 3 "}, + counts = {IRNode.AND_VI, IRNode.VECTOR_SIZE_16, " > 0 ", + IRNode.XOR_VI, IRNode.VECTOR_SIZE_16, " > 0 "}) public void testInt4_Int512(int[] r, int[] a, int[] b, int[] c, boolean [] mask) { testInt4Kernel(IntVector.SPECIES_512, r, a, b, c, mask); } diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java b/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java index d9d282c52d4..ad5dd8aa3e7 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java @@ -81,7 +81,7 @@ public static void main(String args[]) { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VL, " > 0 "}) public void test_reversebytes_long_transform1(long[] lout, long[] linp) { VectorMask mask = VectorMask.fromLong(LSPECIES, 3); for (int i = 0; i < LSPECIES.loopBound(linp.length); i+=LSPECIES.length()) { @@ -100,7 +100,7 @@ public void kernel_test_reversebytes_long_transform1() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VL, " > 0 "}) public void test_reversebytes_long_transform2(long[] lout, long[] linp) { VectorMask mask1 = VectorMask.fromLong(LSPECIES, 3); VectorMask mask2 = VectorMask.fromLong(LSPECIES, 3); @@ -120,7 +120,7 @@ public void kernel_test_reversebytes_long_transform2() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_VL}) public void test_reversebytes_long_transform3(long[] lout, long[] linp) { for (int i = 0; i < LSPECIES.loopBound(linp.length); i+=LSPECIES.length()) { LongVector.fromArray(LSPECIES, linp, i) @@ -138,7 +138,7 @@ public void kernel_test_reversebytes_long_transform3() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VI, " > 0 "}) public void test_reversebytes_int_transform1(int[] iout, int[] iinp) { VectorMask mask = VectorMask.fromLong(ISPECIES, 3); for (int i = 0; i < ISPECIES.loopBound(iinp.length); i+=ISPECIES.length()) { @@ -157,7 +157,7 @@ public void kernel_test_reversebytes_int_transform1() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VI, " > 0 "}) public void test_reversebytes_int_transform2(int[] iout, int[] iinp) { VectorMask mask1 = VectorMask.fromLong(ISPECIES, 3); VectorMask mask2 = VectorMask.fromLong(ISPECIES, 3); @@ -177,7 +177,7 @@ public void kernel_test_reversebytes_int_transform2() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_VI}) public void test_reversebytes_int_transform3(int[] iout, int[] iinp) { for (int i = 0; i < ISPECIES.loopBound(iinp.length); i+=ISPECIES.length()) { IntVector.fromArray(ISPECIES, iinp, i) @@ -195,7 +195,7 @@ public void kernel_test_reversebytes_int_transform3() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VS, " > 0 "}) public void test_reversebytes_short_transform1(short[] sout, short[] sinp) { VectorMask mask = VectorMask.fromLong(SSPECIES, 3); for (int i = 0; i < SSPECIES.loopBound(sinp.length); i+=SSPECIES.length()) { @@ -214,7 +214,7 @@ public void kernel_test_reversebytes_short_transform1() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_V , " > 0 "}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, counts = {IRNode.REVERSE_BYTES_VS, " > 0 "}) public void test_reversebytes_short_transform2(short[] sout, short[] sinp) { VectorMask mask1 = VectorMask.fromLong(SSPECIES, 3); VectorMask mask2 = VectorMask.fromLong(SSPECIES, 3); @@ -234,7 +234,7 @@ public void kernel_test_reversebytes_short_transform2() { } @Test - @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, failOn = {IRNode.REVERSE_BYTES_VS}) public void test_reversebytes_short_transform3(short[] sout, short[] sinp) { for (int i = 0; i < SSPECIES.loopBound(sinp.length); i+=SSPECIES.length()) { ShortVector.fromArray(SSPECIES, sinp, i) diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransformsSVE.java b/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransformsSVE.java index 1774162b163..13c5c4d6fdf 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransformsSVE.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransformsSVE.java @@ -78,7 +78,7 @@ public static void main(String args[]) { } @Test - @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_VL}) public void test_reversebytes_long_transform(long[] lout, long[] linp) { VectorMask mask = VectorMask.fromLong(LSPECIES, 3); for (int i = 0; i < LSPECIES.loopBound(linp.length); i+=LSPECIES.length()) { @@ -97,7 +97,7 @@ public void kernel_test_reversebytes_long_transform() { } @Test - @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_VI}) public void test_reversebytes_int_transform(int[] iout, int[] iinp) { VectorMask mask = VectorMask.fromLong(ISPECIES, 3); for (int i = 0; i < ISPECIES.loopBound(iinp.length); i+=ISPECIES.length()) { @@ -116,7 +116,7 @@ public void kernel_test_reversebytes_int_transform() { } @Test - @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_V}) + @IR(applyIf = {"UseSVE", " > 0"}, failOn = {IRNode.REVERSE_BYTES_VS}) public void test_reversebytes_short_transform(short[] sout, short[] sinp) { VectorMask mask = VectorMask.fromLong(SSPECIES, 3); for (int i = 0; i < SSPECIES.loopBound(sinp.length); i+=SSPECIES.length()) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestVectorCompressExpandBits.java b/test/hotspot/jtreg/compiler/vectorapi/TestVectorCompressExpandBits.java index 3b92960c181..f5174b7e6dc 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestVectorCompressExpandBits.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestVectorCompressExpandBits.java @@ -77,7 +77,7 @@ public class TestVectorCompressExpandBits { // Test for vectorized Integer.compress operation in SVE2 @Test - @IR(counts = {IRNode.COMPRESS_BITSV, "> 0"}) + @IR(counts = {IRNode.COMPRESS_BITS_VI, "> 0"}) public static void testIntCompress() { for (int i = 0; i < LENGTH; i += I_SPECIES.length()) { IntVector av = IntVector.fromArray(I_SPECIES, ia, i); @@ -96,7 +96,7 @@ public static void testIntCompress_runner() { // Test for vectorized Integer.expand operation in SVE2 @Test - @IR(counts = {IRNode.EXPAND_BITSV, "> 0"}) + @IR(counts = {IRNode.EXPAND_BITS_VI, "> 0"}) public static void testIntExpand() { for (int i = 0; i < LENGTH; i += I_SPECIES.length()) { IntVector av = IntVector.fromArray(I_SPECIES, ia, i); @@ -115,7 +115,7 @@ public static void testIntExpand_runner() { // Test for vectorized Long.compress operation in SVE2 @Test - @IR(counts = {IRNode.COMPRESS_BITSV, "> 0"}) + @IR(counts = {IRNode.COMPRESS_BITS_VL, "> 0"}) public static void testLongCompress() { for (int i = 0; i < LENGTH; i += L_SPECIES.length()) { LongVector av = LongVector.fromArray(L_SPECIES, la, i); @@ -134,7 +134,7 @@ public static void testLongCompress_runner() { // Test for vectorized Long.expand operation in SVE2 @Test - @IR(counts = {IRNode.EXPAND_BITSV, "> 0"}) + @IR(counts = {IRNode.EXPAND_BITS_VL, "> 0"}) public static void testLongExpand() { for (int i = 0; i < LENGTH; i += L_SPECIES.length()) { LongVector av = LongVector.fromArray(L_SPECIES, la, i); diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorFPtoIntCastTest.java b/test/hotspot/jtreg/compiler/vectorapi/VectorFPtoIntCastTest.java index ddc543e4a33..8d5d872375f 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/VectorFPtoIntCastTest.java +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorFPtoIntCastTest.java @@ -86,7 +86,8 @@ public VectorFPtoIntCastTest() { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void float2int() { var cvec = (IntVector)fvec512.convertShape(VectorOperators.F2I, ispec512, 0); cvec.intoArray(int_arr, 0); @@ -103,7 +104,8 @@ public void checkf2int(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2X, "> 0"}, applyIfCPUFeature = {"avx512dq", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512dq", "true"}) public void float2long() { var cvec = (LongVector)fvec512.convertShape(VectorOperators.F2L, lspec512, 0); cvec.intoArray(long_arr, 0); @@ -120,7 +122,8 @@ public void checkf2long(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void float2short() { var cvec = (ShortVector)fvec512.convertShape(VectorOperators.F2S, sspec256, 0); cvec.intoArray(short_arr, 0); @@ -137,7 +140,8 @@ public void checkf2short(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void float2byte() { var cvec = (ByteVector)fvec512.convertShape(VectorOperators.F2B, bspec128, 0); cvec.intoArray(byte_arr, 0); @@ -154,7 +158,8 @@ public void checkf2byte(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_D2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void double2int() { var cvec = (IntVector)dvec512.convertShape(VectorOperators.D2I, ispec256, 0); cvec.intoArray(int_arr, 0); @@ -171,7 +176,8 @@ public void checkd2int(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_D2X, "> 0"}, applyIfCPUFeature = {"avx512dq", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512dq", "true"}) public void double2long() { var cvec = (LongVector)dvec512.convertShape(VectorOperators.D2L, lspec512, 0); cvec.intoArray(long_arr, 0); @@ -188,7 +194,8 @@ public void checkd2long(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_D2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void double2short() { var cvec = (ShortVector)dvec512.convertShape(VectorOperators.D2S, sspec128, 0); cvec.intoArray(short_arr, 0); @@ -205,7 +212,8 @@ public void checkd2short(int len) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_D2X, "> 0"}, applyIfCPUFeature = {"avx512f", "true"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIfCPUFeature = {"avx512f", "true"}) public void double2byte() { var cvec = (ByteVector)dvec512.convertShape(VectorOperators.D2B, bspec64, 0); cvec.intoArray(byte_arr, 0); diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java b/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java index 0ed3d5638a9..426dec67019 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java @@ -104,7 +104,7 @@ private static long and(long a, long b) { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VB, counts = {IRNode.LOAD_VECTOR_B, ">=1"}) public static void testAndMinusOne() { ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); av.and((byte) -1).intoArray(br, 0); @@ -117,7 +117,7 @@ public static void testAndMinusOne() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VS, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testAndZero() { ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); av.and((short) 0).intoArray(sr, 0); @@ -130,7 +130,7 @@ public static void testAndZero() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VI, counts = {IRNode.LOAD_VECTOR_I, ">=1"}) public static void testAndSame() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); av.and(av).intoArray(ir, 0); @@ -143,7 +143,7 @@ public static void testAndSame() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VL, counts = {IRNode.LOAD_VECTOR_L, ">=1"}) public static void testMaskedAndMinusOne1() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -163,8 +163,8 @@ public static void testMaskedAndMinusOne1() { // Masked AndV in this test should not be optimized out on SVE. @Test @Warmup(10000) - @IR(counts = {IRNode.LOAD_VECTOR, ">=1"}) - @IR(failOn = IRNode.AND_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(counts = {IRNode.LOAD_VECTOR_B, ">=1"}) + @IR(failOn = IRNode.AND_VB, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedAndMinusOne2() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); @@ -185,7 +185,7 @@ public static void testMaskedAndMinusOne2() { @Test @Warmup(10000) @IR(counts = {IRNode.STORE_VECTOR, ">=1"}) - @IR(failOn = IRNode.AND_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(failOn = IRNode.AND_VS, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedAndZero1() { VectorMask mask = VectorMask.fromArray(S_SPECIES, m, 0); ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); @@ -204,7 +204,7 @@ public static void testMaskedAndZero1() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VI, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskedAndZero2() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -223,7 +223,7 @@ public static void testMaskedAndZero2() { @Test @Warmup(10000) - @IR(failOn = IRNode.AND_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.AND_VL, counts = {IRNode.LOAD_VECTOR_L, ">=1"}) public static void testMaskedAndSame() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -242,7 +242,7 @@ public static void testMaskedAndSame() { // Transform AndV(AndV(a, b), b) ==> AndV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}) + @IR(counts = {IRNode.AND_VI, "1"}) public static void testAndSameValue1() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); IntVector bv = IntVector.fromArray(I_SPECIES, ib, 0); @@ -257,7 +257,7 @@ public static void testAndSameValue1() { // Transform AndV(AndV(a, b), a) ==> AndV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}) + @IR(counts = {IRNode.AND_VL, "1"}) public static void testAndSameValue2() { LongVector av = LongVector.fromArray(L_SPECIES, la, 0); LongVector bv = LongVector.fromArray(L_SPECIES, lb, 0); @@ -272,7 +272,7 @@ public static void testAndSameValue2() { // Transform AndV(b, AndV(a, b)) ==> AndV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}) + @IR(counts = {IRNode.AND_VI, "1"}) public static void testAndSameValue3() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); IntVector bv = IntVector.fromArray(I_SPECIES, ib, 0); @@ -287,7 +287,7 @@ public static void testAndSameValue3() { // Transform AndV(a, AndV(a, b)) ==> AndV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}) + @IR(counts = {IRNode.AND_VL, "1"}) public static void testAndSameValue4() { LongVector av = LongVector.fromArray(L_SPECIES, la, 0); LongVector bv = LongVector.fromArray(L_SPECIES, lb, 0); @@ -302,7 +302,7 @@ public static void testAndSameValue4() { // Transform AndV(AndV(a, b, m), b, m) ==> AndV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.AND_VI, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testAndMaskSameValue1() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -323,7 +323,7 @@ public static void testAndMaskSameValue1() { // Transform AndV(AndV(a, b, m), a, m) ==> AndV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.AND_VL, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testAndMaskSameValue2() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -344,7 +344,7 @@ public static void testAndMaskSameValue2() { // Transform AndV(a, AndV(a, b, m), m) ==> AndV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.AND_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.AND_VI, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testAndMaskSameValue3() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -368,7 +368,7 @@ private static long or(long a, long b) { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VB, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testOrMinusOne() { ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); av.or((byte) -1).intoArray(br, 0); @@ -381,7 +381,7 @@ public static void testOrMinusOne() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VS, counts = {IRNode.LOAD_VECTOR_S, ">=1"}) public static void testOrZero() { ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); av.or((short) 0).intoArray(sr, 0); @@ -394,7 +394,7 @@ public static void testOrZero() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VI, counts = {IRNode.LOAD_VECTOR_I, ">=1"}) public static void testOrSame() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); av.or(av).intoArray(ir, 0); @@ -409,7 +409,7 @@ public static void testOrSame() { @Test @Warmup(10000) @IR(counts = {IRNode.STORE_VECTOR, ">=1"}) - @IR(failOn = IRNode.OR_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(failOn = IRNode.OR_VB, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedOrMinusOne1() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); @@ -428,7 +428,7 @@ public static void testMaskedOrMinusOne1() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VB, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskedOrMinusOne2() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); @@ -447,7 +447,7 @@ public static void testMaskedOrMinusOne2() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VS, counts = {IRNode.LOAD_VECTOR_S, ">=1"}) public static void testMaskedOrZero1() { VectorMask mask = VectorMask.fromArray(S_SPECIES, m, 0); ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); @@ -467,8 +467,8 @@ public static void testMaskedOrZero1() { // Masked OrV in this test should not be optimized out on SVE. @Test @Warmup(10000) - @IR(counts = {IRNode.LOAD_VECTOR, ">=1"}) - @IR(failOn = IRNode.OR_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(counts = {IRNode.LOAD_VECTOR_B, ">=1"}) + @IR(failOn = IRNode.OR_VB, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedOrZero2() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); @@ -487,7 +487,7 @@ public static void testMaskedOrZero2() { @Test @Warmup(10000) - @IR(failOn = IRNode.OR_V, counts = {IRNode.LOAD_VECTOR, ">=1"}) + @IR(failOn = IRNode.OR_VL, counts = {IRNode.LOAD_VECTOR_L, ">=1"}) public static void testMaskedOrSame() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -506,7 +506,7 @@ public static void testMaskedOrSame() { // Transform OrV(OrV(a, b), b) ==> OrV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}) + @IR(counts = {IRNode.OR_VI, "1"}) public static void testOrSameValue1() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); IntVector bv = IntVector.fromArray(I_SPECIES, ib, 0); @@ -521,7 +521,7 @@ public static void testOrSameValue1() { // Transform OrV(OrV(a, b), a) ==> OrV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}) + @IR(counts = {IRNode.OR_VL, "1"}) public static void testOrSameValue2() { LongVector av = LongVector.fromArray(L_SPECIES, la, 0); LongVector bv = LongVector.fromArray(L_SPECIES, lb, 0); @@ -536,7 +536,7 @@ public static void testOrSameValue2() { // Transform OrV(b, OrV(a, b)) ==> OrV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}) + @IR(counts = {IRNode.OR_VI, "1"}) public static void testOrSameValue3() { IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); IntVector bv = IntVector.fromArray(I_SPECIES, ib, 0); @@ -551,7 +551,7 @@ public static void testOrSameValue3() { // Transform OrV(a, OrV(a, b)) ==> OrV(a, b) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}) + @IR(counts = {IRNode.OR_VL, "1"}) public static void testOrSameValue4() { LongVector av = LongVector.fromArray(L_SPECIES, la, 0); LongVector bv = LongVector.fromArray(L_SPECIES, lb, 0); @@ -566,7 +566,7 @@ public static void testOrSameValue4() { // Transform OrV(OrV(a, b, m), b, m) ==> OrV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.OR_VI, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testOrMaskSameValue1() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -587,7 +587,7 @@ public static void testOrMaskSameValue1() { // Transform OrV(OrV(a, b, m), a, m) ==> OrV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.OR_VL, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testOrMaskSameValue2() { VectorMask mask = VectorMask.fromArray(L_SPECIES, m, 0); LongVector av = LongVector.fromArray(L_SPECIES, la, 0); @@ -608,7 +608,7 @@ public static void testOrMaskSameValue2() { // Transform OrV(a, OrV(a, b, m), m) ==> OrV(a, b, m) @Test @Warmup(10000) - @IR(counts = {IRNode.OR_V, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) + @IR(counts = {IRNode.OR_VI, "1"}, applyIfCPUFeatureOr = {"sve", "true", "avx512", "true"}) public static void testOrMaskSameValue3() { VectorMask mask = VectorMask.fromArray(I_SPECIES, m, 0); IntVector av = IntVector.fromArray(I_SPECIES, ia, 0); @@ -632,7 +632,7 @@ private static long xor(long a, long b) { @Test @Warmup(10000) - @IR(failOn = IRNode.XOR_V, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = IRNode.XOR_VB, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testXorSame() { ByteVector av = ByteVector.fromArray(B_SPECIES, ba, 0); av.lanewise(VectorOperators.XOR, av).intoArray(br, 0); @@ -647,7 +647,7 @@ public static void testXorSame() { @Test @Warmup(10000) @IR(counts = {IRNode.STORE_VECTOR, ">=1"}) - @IR(failOn = IRNode.XOR_V, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) + @IR(failOn = IRNode.XOR_VS, applyIfCPUFeatureAnd = {"asimd", "true", "sve", "false"}) public static void testMaskedXorSame() { VectorMask mask = VectorMask.fromArray(S_SPECIES, m, 0); ShortVector av = ShortVector.fromArray(S_SPECIES, sa, 0); @@ -666,7 +666,7 @@ public static void testMaskedXorSame() { // Following are the vector mask logic operations tests @Test @Warmup(10000) - @IR(failOn = {IRNode.AND_V, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.AND_VI, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskAndMinusOne() { VectorMask ma = VectorMask.fromArray(I_SPECIES, m, 0); VectorMask mb = I_SPECIES.maskAll(true); @@ -680,7 +680,7 @@ public static void testMaskAndMinusOne() { @Test @Warmup(10000) - @IR(failOn = {IRNode.AND_V, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.AND_VS, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskAndZero() { VectorMask ma = VectorMask.fromArray(S_SPECIES, m, 0); VectorMask mb = S_SPECIES.maskAll(false); @@ -694,7 +694,7 @@ public static void testMaskAndZero() { @Test @Warmup(10000) - @IR(failOn = {IRNode.AND_V, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.AND_VB, IRNode.AND_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskAndSame() { VectorMask ma = VectorMask.fromArray(B_SPECIES, m, 0); ma.and(ma).intoArray(mr, 0); @@ -707,7 +707,7 @@ public static void testMaskAndSame() { @Test @Warmup(10000) - @IR(failOn = {IRNode.OR_V, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.OR_VS, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskOrMinusOne() { VectorMask ma = VectorMask.fromArray(S_SPECIES, m, 0); VectorMask mb = S_SPECIES.maskAll(true); @@ -721,7 +721,7 @@ public static void testMaskOrMinusOne() { @Test @Warmup(10000) - @IR(failOn = {IRNode.OR_V, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.OR_VI, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskOrZero() { VectorMask ma = VectorMask.fromArray(I_SPECIES, m, 0); VectorMask mb = I_SPECIES.maskAll(false); @@ -735,7 +735,7 @@ public static void testMaskOrZero() { @Test @Warmup(10000) - @IR(failOn = {IRNode.OR_V, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.OR_VB, IRNode.OR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskOrSame() { VectorMask ma = VectorMask.fromArray(B_SPECIES, m, 0); ma.or(ma).intoArray(mr, 0); @@ -748,7 +748,7 @@ public static void testMaskOrSame() { @Test @Warmup(10000) - @IR(failOn = {IRNode.XOR_V, IRNode.XOR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) + @IR(failOn = {IRNode.XOR_VI, IRNode.XOR_V_MASK}, counts = {IRNode.STORE_VECTOR, ">=1"}) public static void testMaskXorSame() { VectorMask ma = I_SPECIES.maskAll(true); ma.not().intoArray(mr, 0); diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorReverseBytesTest.java b/test/hotspot/jtreg/compiler/vectorapi/VectorReverseBytesTest.java index 7205c262280..154567922bd 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/VectorReverseBytesTest.java +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorReverseBytesTest.java @@ -70,7 +70,7 @@ public class VectorReverseBytesTest { } @Test - @IR(failOn = IRNode.REVERSE_BYTES_V) + @IR(failOn = IRNode.REVERSE_BYTES_VB) public static void testReverseBytesV() { for (int i = 0; i < LENGTH; i += B_SPECIES.length()) { ByteVector v = ByteVector.fromArray(B_SPECIES, input, i); @@ -84,8 +84,8 @@ public static void testReverseBytesV() { } @Test - @IR(failOn = IRNode.REVERSE_BYTES_V) - @IR(failOn = IRNode.VECTOR_BLEND) + @IR(failOn = IRNode.REVERSE_BYTES_VB) + @IR(failOn = IRNode.VECTOR_BLEND_B) public static void testReverseBytesVMasked() { VectorMask mask = VectorMask.fromArray(B_SPECIES, m, 0); for (int i = 0; i < LENGTH; i += B_SPECIES.length()) { diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorCast.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorCast.java index 47dcbab8f71..63058e6d453 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorCast.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/tests/TestVectorCast.java @@ -26,6 +26,7 @@ import compiler.lib.ir_framework.IR; import compiler.lib.ir_framework.Run; import compiler.lib.ir_framework.Test; +import compiler.lib.ir_framework.IRNode; import static compiler.vectorapi.reshape.utils.VectorReshapeHelper.*; import static jdk.incubator.vector.VectorOperators.*; @@ -44,7 +45,7 @@ */ public class TestVectorCast { @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toS64(byte[] input, short[] output) { vectorCast(B2S, BSPEC64, SSPEC64, input, output); } @@ -55,7 +56,7 @@ public static void runB64toS64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toS128(byte[] input, short[] output) { vectorCast(B2S, BSPEC64, SSPEC128, input, output); } @@ -66,7 +67,7 @@ public static void runB64toS128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE_16, "1"}) public static void testB128toS256(byte[] input, short[] output) { vectorCast(B2S, BSPEC128, SSPEC256, input, output); } @@ -77,7 +78,7 @@ public static void runB128toS256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2S, IRNode.VECTOR_SIZE_32, "1"}) public static void testB256toS512(byte[] input, short[] output) { vectorCast(B2S, BSPEC256, SSPEC512, input, output); } @@ -88,7 +89,7 @@ public static void runB256toS512() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toI64(byte[] input, int[] output) { vectorCast(B2I, BSPEC64, ISPEC64, input, output); } @@ -99,7 +100,7 @@ public static void runB64toI64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toI128(byte[] input, int[] output) { vectorCast(B2I, BSPEC64, ISPEC128, input, output); } @@ -110,7 +111,7 @@ public static void runB64toI128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toI256(byte[] input, int[] output) { vectorCast(B2I, BSPEC64, ISPEC256, input, output); } @@ -121,7 +122,7 @@ public static void runB64toI256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testB128toI512(byte[] input, int[] output) { vectorCast(B2I, BSPEC128, ISPEC512, input, output); } @@ -132,7 +133,7 @@ public static void runB128toI512() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toL64(byte[] input, long[] output) { vectorCast(B2L, BSPEC64, LSPEC64, input, output); } @@ -143,7 +144,7 @@ public static void runB64toL64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toL128(byte[] input, long[] output) { vectorCast(B2L, BSPEC64, LSPEC128, input, output); } @@ -154,7 +155,7 @@ public static void runB64toL128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toL256(byte[] input, long[] output) { vectorCast(B2L, BSPEC64, LSPEC256, input, output); } @@ -165,7 +166,7 @@ public static void runB64toL256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toL512(byte[] input, long[] output) { vectorCast(B2L, BSPEC64, LSPEC512, input, output); } @@ -176,7 +177,7 @@ public static void runB64toL512() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toF64(byte[] input, float[] output) { vectorCast(B2F, BSPEC64, FSPEC64, input, output); } @@ -187,7 +188,7 @@ public static void runB64toF64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toF128(byte[] input, float[] output) { vectorCast(B2F, BSPEC64, FSPEC128, input, output); } @@ -198,7 +199,7 @@ public static void runB64toF128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toF256(byte[] input, float[] output) { vectorCast(B2F, BSPEC64, FSPEC256, input, output); } @@ -209,7 +210,7 @@ public static void runB64toF256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2F, IRNode.VECTOR_SIZE_16, "1"}) public static void testB128toF512(byte[] input, float[] output) { vectorCast(B2F, BSPEC128, FSPEC512, input, output); } @@ -220,7 +221,7 @@ public static void runB128toF512() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toD64(byte[] input, double[] output) { vectorCast(B2D, BSPEC64, DSPEC64, input, output); } @@ -231,7 +232,7 @@ public static void runB64toD64() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testB64toD128(byte[] input, double[] output) { vectorCast(B2D, BSPEC64, DSPEC128, input, output); } @@ -242,7 +243,7 @@ public static void runB64toD128() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testB64toD256(byte[] input, double[] output) { vectorCast(B2D, BSPEC64, DSPEC256, input, output); } @@ -253,7 +254,7 @@ public static void runB64toD256() throws Throwable { } @Test - @IR(counts = {B2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_B2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testB64toD512(byte[] input, double[] output) { vectorCast(B2D, BSPEC64, DSPEC512, input, output); } @@ -264,7 +265,7 @@ public static void runB64toD512() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toB64(short[] input, byte[] output) { vectorCast(S2B, SSPEC64, BSPEC64, input, output); } @@ -275,7 +276,7 @@ public static void runS64toB64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toB64(short[] input, byte[] output) { vectorCast(S2B, SSPEC128, BSPEC64, input, output); } @@ -286,7 +287,7 @@ public static void runS128toB64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE_16, "1"}) public static void testS256toB128(short[] input, byte[] output) { vectorCast(S2B, SSPEC256, BSPEC128, input, output); } @@ -297,7 +298,7 @@ public static void runS256toB128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2B, IRNode.VECTOR_SIZE_32, "1"}) public static void testS512toB256(short[] input, byte[] output) { vectorCast(S2B, SSPEC512, BSPEC256, input, output); } @@ -308,7 +309,7 @@ public static void runS512toB256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toI64(short[] input, int[] output) { vectorCast(S2I, SSPEC64, ISPEC64, input, output); } @@ -319,7 +320,7 @@ public static void runS64toI64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toI128(short[] input, int[] output) { vectorCast(S2I, SSPEC64, ISPEC128, input, output); } @@ -330,7 +331,7 @@ public static void runS64toI128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toI256(short[] input, int[] output) { vectorCast(S2I, SSPEC128, ISPEC256, input, output); } @@ -341,7 +342,7 @@ public static void runS128toI256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testS256toI512(short[] input, int[] output) { vectorCast(S2I, SSPEC256, ISPEC512, input, output); } @@ -352,7 +353,7 @@ public static void runS256toI512() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toL64(short[] input, long[] output) { vectorCast(S2L, SSPEC64, LSPEC64, input, output); } @@ -363,7 +364,7 @@ public static void runS64toL64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toL128(short[] input, long[] output) { vectorCast(S2L, SSPEC64, LSPEC128, input, output); } @@ -374,7 +375,7 @@ public static void runS64toL128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toL256(short[] input, long[] output) { vectorCast(S2L, SSPEC64, LSPEC256, input, output); } @@ -385,7 +386,7 @@ public static void runS64toL256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toL512(short[] input, long[] output) { vectorCast(S2L, SSPEC128, LSPEC512, input, output); } @@ -396,7 +397,7 @@ public static void runS128toL512() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toF64(short[] input, float[] output) { vectorCast(S2F, SSPEC64, FSPEC64, input, output); } @@ -407,7 +408,7 @@ public static void runS64toF64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toF128(short[] input, float[] output) { vectorCast(S2F, SSPEC64, FSPEC128, input, output); } @@ -418,7 +419,7 @@ public static void runS64toF128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toF256(short[] input, float[] output) { vectorCast(S2F, SSPEC128, FSPEC256, input, output); } @@ -429,7 +430,7 @@ public static void runS128toF256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE_16, "1"}) public static void testS256toF512(short[] input, float[] output) { vectorCast(S2F, SSPEC256, FSPEC512, input, output); } @@ -440,7 +441,7 @@ public static void runS256toF512() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toD64(short[] input, double[] output) { vectorCast(S2D, SSPEC64, DSPEC64, input, output); } @@ -451,7 +452,7 @@ public static void runS64toD64() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testS64toD128(short[] input, double[] output) { vectorCast(S2D, SSPEC64, DSPEC128, input, output); } @@ -462,7 +463,7 @@ public static void runS64toD128() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testS64toD256(short[] input, double[] output) { vectorCast(S2D, SSPEC64, DSPEC256, input, output); } @@ -473,7 +474,7 @@ public static void runS64toD256() throws Throwable { } @Test - @IR(counts = {S2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testS128toD512(short[] input, double[] output) { vectorCast(S2D, SSPEC128, DSPEC512, input, output); } @@ -484,7 +485,7 @@ public static void runS128toD512() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toB64(int[] input, byte[] output) { vectorCast(I2B, ISPEC64, BSPEC64, input, output); } @@ -495,7 +496,7 @@ public static void runI64toB64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toB64(int[] input, byte[] output) { vectorCast(I2B, ISPEC128, BSPEC64, input, output); } @@ -506,7 +507,7 @@ public static void runI128toB64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toB64(int[] input, byte[] output) { vectorCast(I2B, ISPEC256, BSPEC64, input, output); } @@ -517,7 +518,7 @@ public static void runI256toB64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2B, IRNode.VECTOR_SIZE_16, "1"}) public static void testI512toB128(int[] input, byte[] output) { vectorCast(I2B, ISPEC512, BSPEC128, input, output); } @@ -528,7 +529,7 @@ public static void runI512toB128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toS64(int[] input, short[] output) { vectorCast(I2S, ISPEC64, SSPEC64, input, output); } @@ -539,7 +540,7 @@ public static void runI64toS64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toS64(int[] input, short[] output) { vectorCast(I2S, ISPEC128, SSPEC64, input, output); } @@ -550,7 +551,7 @@ public static void runI128toS64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toS128(int[] input, short[] output) { vectorCast(I2S, ISPEC256, SSPEC128, input, output); } @@ -561,7 +562,7 @@ public static void runI256toS128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2S, IRNode.VECTOR_SIZE_16, "1"}) public static void testI512toS256(int[] input, short[] output) { vectorCast(I2S, ISPEC512, SSPEC256, input, output); } @@ -572,7 +573,7 @@ public static void runI512toS256() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toL64(int[] input, long[] output) { vectorCast(I2L, ISPEC64, LSPEC64, input, output); } @@ -583,7 +584,7 @@ public static void runI64toL64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toL128(int[] input, long[] output) { vectorCast(I2L, ISPEC64, LSPEC128, input, output); } @@ -594,7 +595,7 @@ public static void runI64toL128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toL256(int[] input, long[] output) { vectorCast(I2L, ISPEC128, LSPEC256, input, output); } @@ -605,7 +606,7 @@ public static void runI128toL256() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toL512(int[] input, long[] output) { vectorCast(I2L, ISPEC256, LSPEC512, input, output); } @@ -616,7 +617,7 @@ public static void runI256toL512() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toF64(int[] input, float[] output) { vectorCast(I2F, ISPEC64, FSPEC64, input, output); } @@ -627,7 +628,7 @@ public static void runI64toF64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toF128(int[] input, float[] output) { vectorCast(I2F, ISPEC128, FSPEC128, input, output); } @@ -638,7 +639,7 @@ public static void runI128toF128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toF256(int[] input, float[] output) { vectorCast(I2F, ISPEC256, FSPEC256, input, output); } @@ -649,7 +650,7 @@ public static void runI256toF256() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE_16, "1"}) public static void testI512toF512(int[] input, float[] output) { vectorCast(I2F, ISPEC512, FSPEC512, input, output); } @@ -660,7 +661,7 @@ public static void runI512toF512() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toD64(int[] input, double[] output) { vectorCast(I2D, ISPEC64, DSPEC64, input, output); } @@ -671,7 +672,7 @@ public static void runI64toD64() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testI64toD128(int[] input, double[] output) { vectorCast(I2D, ISPEC64, DSPEC128, input, output); } @@ -682,7 +683,7 @@ public static void runI64toD128() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testI128toD256(int[] input, double[] output) { vectorCast(I2D, ISPEC128, DSPEC256, input, output); } @@ -693,7 +694,7 @@ public static void runI128toD256() throws Throwable { } @Test - @IR(counts = {I2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testI256toD512(int[] input, double[] output) { vectorCast(I2D, ISPEC256, DSPEC512, input, output); } @@ -704,7 +705,7 @@ public static void runI256toD512() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toB64(long[] input, byte[] output) { vectorCast(L2B, LSPEC64, BSPEC64, input, output); } @@ -715,7 +716,7 @@ public static void runL64toB64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toB64(long[] input, byte[] output) { vectorCast(L2B, LSPEC128, BSPEC64, input, output); } @@ -726,7 +727,7 @@ public static void runL128toB64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toB64(long[] input, byte[] output) { vectorCast(L2B, LSPEC256, BSPEC64, input, output); } @@ -737,7 +738,7 @@ public static void runL256toB64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toB64(long[] input, byte[] output) { vectorCast(L2B, LSPEC512, BSPEC64, input, output); } @@ -748,7 +749,7 @@ public static void runL512toB64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toS64(long[] input, short[] output) { vectorCast(L2S, LSPEC64, SSPEC64, input, output); } @@ -759,7 +760,7 @@ public static void runL64toS64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toS64(long[] input, short[] output) { vectorCast(L2S, LSPEC128, SSPEC64, input, output); } @@ -770,7 +771,7 @@ public static void runL128toS64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toS64(long[] input, short[] output) { vectorCast(L2S, LSPEC256, SSPEC64, input, output); } @@ -781,7 +782,7 @@ public static void runL256toS64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toS128(long[] input, short[] output) { vectorCast(L2S, LSPEC512, SSPEC128, input, output); } @@ -792,7 +793,7 @@ public static void runL512toS128() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toI64(long[] input, int[] output) { vectorCast(L2I, LSPEC64, ISPEC64, input, output); } @@ -803,7 +804,7 @@ public static void runL64toI64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toI64(long[] input, int[] output) { vectorCast(L2I, LSPEC128, ISPEC64, input, output); } @@ -814,7 +815,7 @@ public static void runL128toI64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toI128(long[] input, int[] output) { vectorCast(L2I, LSPEC256, ISPEC128, input, output); } @@ -825,7 +826,7 @@ public static void runL256toI128() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toI256(long[] input, int[] output) { vectorCast(L2I, LSPEC512, ISPEC256, input, output); } @@ -836,7 +837,7 @@ public static void runL512toI256() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toF64(long[] input, float[] output) { vectorCast(L2F, LSPEC64, FSPEC64, input, output); } @@ -847,7 +848,7 @@ public static void runL64toF64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toF64(long[] input, float[] output) { vectorCast(L2F, LSPEC128, FSPEC64, input, output); } @@ -858,7 +859,7 @@ public static void runL128toF64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toF128(long[] input, float[] output) { vectorCast(L2F, LSPEC256, FSPEC128, input, output); } @@ -869,7 +870,7 @@ public static void runL256toF128() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toF256(long[] input, float[] output) { vectorCast(L2F, LSPEC512, FSPEC256, input, output); } @@ -880,7 +881,7 @@ public static void runL512toF256() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testL64toD64(long[] input, double[] output) { vectorCast(L2D, LSPEC64, DSPEC64, input, output); } @@ -891,7 +892,7 @@ public static void runL64toD64() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testL128toD128(long[] input, double[] output) { vectorCast(L2D, LSPEC128, DSPEC128, input, output); } @@ -902,7 +903,7 @@ public static void runL128toD128() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testL256toD256(long[] input, double[] output) { vectorCast(L2D, LSPEC256, DSPEC256, input, output); } @@ -913,7 +914,7 @@ public static void runL256toD256() throws Throwable { } @Test - @IR(counts = {L2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testL512toD512(long[] input, double[] output) { vectorCast(L2D, LSPEC512, DSPEC512, input, output); } @@ -924,7 +925,7 @@ public static void runL512toD512() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toB64(float[] input, byte[] output) { vectorCast(F2B, FSPEC64, BSPEC64, input, output); } @@ -935,7 +936,7 @@ public static void runF64toB64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toB64(float[] input, byte[] output) { vectorCast(F2B, FSPEC128, BSPEC64, input, output); } @@ -946,7 +947,7 @@ public static void runF128toB64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toB64(float[] input, byte[] output) { vectorCast(F2B, FSPEC256, BSPEC64, input, output); } @@ -957,7 +958,7 @@ public static void runF256toB64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2B, IRNode.VECTOR_SIZE_16, "1"}) public static void testF512toB128(float[] input, byte[] output) { vectorCast(F2B, FSPEC512, BSPEC128, input, output); } @@ -968,7 +969,7 @@ public static void runF512toB128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toS64(float[] input, short[] output) { vectorCast(F2S, FSPEC64, SSPEC64, input, output); } @@ -979,7 +980,7 @@ public static void runF64toS64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toS64(float[] input, short[] output) { vectorCast(F2S, FSPEC128, SSPEC64, input, output); } @@ -990,7 +991,7 @@ public static void runF128toS64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toS128(float[] input, short[] output) { vectorCast(F2S, FSPEC256, SSPEC128, input, output); } @@ -1001,7 +1002,7 @@ public static void runF256toS128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE_16, "1"}) public static void testF512toS256(float[] input, short[] output) { vectorCast(F2S, FSPEC512, SSPEC256, input, output); } @@ -1012,7 +1013,7 @@ public static void runF512toS256() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toI64(float[] input, int[] output) { vectorCast(F2I, FSPEC64, ISPEC64, input, output); } @@ -1023,7 +1024,7 @@ public static void runF64toI64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toI128(float[] input, int[] output) { vectorCast(F2I, FSPEC128, ISPEC128, input, output); } @@ -1034,7 +1035,7 @@ public static void runF128toI128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toI256(float[] input, int[] output) { vectorCast(F2I, FSPEC256, ISPEC256, input, output); } @@ -1045,7 +1046,7 @@ public static void runF256toI256() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testF512toI512(float[] input, int[] output) { vectorCast(F2I, FSPEC512, ISPEC512, input, output); } @@ -1056,7 +1057,7 @@ public static void runF512toI512() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toL64(float[] input, long[] output) { vectorCast(F2L, FSPEC64, LSPEC64, input, output); } @@ -1067,7 +1068,7 @@ public static void runF64toL64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toL128(float[] input, long[] output) { vectorCast(F2L, FSPEC64, LSPEC128, input, output); } @@ -1078,7 +1079,7 @@ public static void runF64toL128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toL256(float[] input, long[] output) { vectorCast(F2L, FSPEC128, LSPEC256, input, output); } @@ -1089,7 +1090,7 @@ public static void runF128toL256() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toL512(float[] input, long[] output) { vectorCast(F2L, FSPEC256, LSPEC512, input, output); } @@ -1100,7 +1101,7 @@ public static void runF256toL512() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testF64toD64(float[] input, double[] output) { vectorCast(F2D, FSPEC64, DSPEC64, input, output); } @@ -1111,7 +1112,7 @@ public static void runF64toD64() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE_2, "1"}) public static void testF64toD128(float[] input, double[] output) { vectorCast(F2D, FSPEC64, DSPEC128, input, output); } @@ -1122,7 +1123,7 @@ public static void runF64toD128() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE_4, "1"}) public static void testF128toD256(float[] input, double[] output) { vectorCast(F2D, FSPEC128, DSPEC256, input, output); } @@ -1133,7 +1134,7 @@ public static void runF128toD256() throws Throwable { } @Test - @IR(counts = {F2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE_8, "1"}) public static void testF256toD512(float[] input, double[] output) { vectorCast(F2D, FSPEC256, DSPEC512, input, output); } @@ -1144,7 +1145,7 @@ public static void runF256toD512() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testD64toB64(double[] input, byte[] output) { vectorCast(D2B, DSPEC64, BSPEC64, input, output); } @@ -1155,7 +1156,7 @@ public static void runD64toB64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toB64(double[] input, byte[] output) { vectorCast(D2B, DSPEC128, BSPEC64, input, output); } @@ -1166,7 +1167,7 @@ public static void runD128toB64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toB64(double[] input, byte[] output) { vectorCast(D2B, DSPEC256, BSPEC64, input, output); } @@ -1177,7 +1178,7 @@ public static void runD256toB64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2B, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toB64(double[] input, byte[] output) { vectorCast(D2B, DSPEC512, BSPEC64, input, output); } @@ -1188,7 +1189,7 @@ public static void runD512toB64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testD64toS64(double[] input, short[] output) { vectorCast(D2S, DSPEC64, SSPEC64, input, output); } @@ -1199,7 +1200,7 @@ public static void runD64toS64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toS64(double[] input, short[] output) { vectorCast(D2S, DSPEC128, SSPEC64, input, output); } @@ -1210,7 +1211,7 @@ public static void runD128toS64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toS64(double[] input, short[] output) { vectorCast(D2S, DSPEC256, SSPEC64, input, output); } @@ -1221,7 +1222,7 @@ public static void runD256toS64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toS128(double[] input, short[] output) { vectorCast(D2S, DSPEC512, SSPEC128, input, output); } @@ -1232,7 +1233,7 @@ public static void runD512toS128() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testD64toI64(double[] input, int[] output) { vectorCast(D2I, DSPEC64, ISPEC64, input, output); } @@ -1243,7 +1244,7 @@ public static void runD64toI64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toI64(double[] input, int[] output) { vectorCast(D2I, DSPEC128, ISPEC64, input, output); } @@ -1254,7 +1255,7 @@ public static void runD128toI64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toI128(double[] input, int[] output) { vectorCast(D2I, DSPEC256, ISPEC128, input, output); } @@ -1265,7 +1266,7 @@ public static void runD256toI128() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toI256(double[] input, int[] output) { vectorCast(D2I, DSPEC512, ISPEC256, input, output); } @@ -1276,7 +1277,7 @@ public static void runD512toI256() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testD64toL64(double[] input, long[] output) { vectorCast(D2L, DSPEC64, LSPEC64, input, output); } @@ -1287,7 +1288,7 @@ public static void runD64toL64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toL128(double[] input, long[] output) { vectorCast(D2L, DSPEC128, LSPEC128, input, output); } @@ -1298,7 +1299,7 @@ public static void runD128toL128() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toL256(double[] input, long[] output) { vectorCast(D2L, DSPEC256, LSPEC256, input, output); } @@ -1309,7 +1310,7 @@ public static void runD256toL256() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toL512(double[] input, long[] output) { vectorCast(D2L, DSPEC512, LSPEC512, input, output); } @@ -1320,7 +1321,7 @@ public static void runD512toL512() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testD64toF64(double[] input, float[] output) { vectorCast(D2F, DSPEC64, FSPEC64, input, output); } @@ -1331,7 +1332,7 @@ public static void runD64toF64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE_2, "1"}) public static void testD128toF64(double[] input, float[] output) { vectorCast(D2F, DSPEC128, FSPEC64, input, output); } @@ -1342,7 +1343,7 @@ public static void runD128toF64() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE_4, "1"}) public static void testD256toF128(double[] input, float[] output) { vectorCast(D2F, DSPEC256, FSPEC128, input, output); } @@ -1353,7 +1354,7 @@ public static void runD256toF128() throws Throwable { } @Test - @IR(counts = {D2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE_8, "1"}) public static void testD512toF256(double[] input, float[] output) { vectorCast(D2F, DSPEC512, FSPEC256, input, output); } @@ -1364,7 +1365,7 @@ public static void runD512toF256() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2S, IRNode.VECTOR_SIZE_4, "1"}) public static void testUB64toS64(byte[] input, short[] output) { vectorCast(ZERO_EXTEND_B2S, BSPEC64, SSPEC64, input, output); } @@ -1375,7 +1376,7 @@ public static void runUB64toS64() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2S, IRNode.VECTOR_SIZE_8, "1"}) public static void testUB64toS128(byte[] input, short[] output) { vectorCast(ZERO_EXTEND_B2S, BSPEC64, SSPEC128, input, output); } @@ -1386,7 +1387,7 @@ public static void runUB64toS128() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2S, IRNode.VECTOR_SIZE_16, "1"}) public static void testUB128toS256(byte[] input, short[] output) { vectorCast(ZERO_EXTEND_B2S, BSPEC128, SSPEC256, input, output); } @@ -1397,7 +1398,7 @@ public static void runUB128toS256() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2S, IRNode.VECTOR_SIZE_32, "1"}) public static void testUB256toS512(byte[] input, short[] output) { vectorCast(ZERO_EXTEND_B2S, BSPEC256, SSPEC512, input, output); } @@ -1408,7 +1409,7 @@ public static void runUB256toS512() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testUB64toI64(byte[] input, int[] output) { vectorCast(ZERO_EXTEND_B2I, BSPEC64, ISPEC64, input, output); } @@ -1419,7 +1420,7 @@ public static void runUB64toI64() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testUB64toI128(byte[] input, int[] output) { vectorCast(ZERO_EXTEND_B2I, BSPEC64, ISPEC128, input, output); } @@ -1430,7 +1431,7 @@ public static void runUB64toI128() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testUB64toI256(byte[] input, int[] output) { vectorCast(ZERO_EXTEND_B2I, BSPEC64, ISPEC256, input, output); } @@ -1441,7 +1442,7 @@ public static void runUB64toI256() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testUB128toI512(byte[] input, int[] output) { vectorCast(ZERO_EXTEND_B2I, BSPEC128, ISPEC512, input, output); } @@ -1452,7 +1453,7 @@ public static void runUB128toI512() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUB64toL64(byte[] input, long[] output) { vectorCast(ZERO_EXTEND_B2L, BSPEC64, LSPEC64, input, output); } @@ -1463,7 +1464,7 @@ public static void runUB64toL64() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUB64toL128(byte[] input, long[] output) { vectorCast(ZERO_EXTEND_B2L, BSPEC64, LSPEC128, input, output); } @@ -1474,7 +1475,7 @@ public static void runUB64toL128() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testUB64toL256(byte[] input, long[] output) { vectorCast(ZERO_EXTEND_B2L, BSPEC64, LSPEC256, input, output); } @@ -1485,7 +1486,7 @@ public static void runUB64toL256() throws Throwable { } @Test - @IR(counts = {UB2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_B2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testUB64toL512(byte[] input, long[] output) { vectorCast(ZERO_EXTEND_B2L, BSPEC64, LSPEC512, input, output); } @@ -1496,7 +1497,7 @@ public static void runUB64toL512() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2I, IRNode.VECTOR_SIZE_2, "1"}) public static void testUS64toI64(short[] input, int[] output) { vectorCast(ZERO_EXTEND_S2I, SSPEC64, ISPEC64, input, output); } @@ -1507,7 +1508,7 @@ public static void runUS64toI64() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2I, IRNode.VECTOR_SIZE_4, "1"}) public static void testUS64toI128(short[] input, int[] output) { vectorCast(ZERO_EXTEND_S2I, SSPEC64, ISPEC128, input, output); } @@ -1518,7 +1519,7 @@ public static void runUS64toI128() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2I, IRNode.VECTOR_SIZE_8, "1"}) public static void testUS128toI256(short[] input, int[] output) { vectorCast(ZERO_EXTEND_S2I, SSPEC128, ISPEC256, input, output); } @@ -1529,7 +1530,7 @@ public static void runUS128toI256() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2I, IRNode.VECTOR_SIZE_16, "1"}) public static void testUS256toI512(short[] input, int[] output) { vectorCast(ZERO_EXTEND_S2I, SSPEC256, ISPEC512, input, output); } @@ -1540,7 +1541,7 @@ public static void runUS256toI512() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUS64toL64(short[] input, long[] output) { vectorCast(ZERO_EXTEND_S2L, SSPEC64, LSPEC64, input, output); } @@ -1551,7 +1552,7 @@ public static void runUS64toL64() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUS64toL128(short[] input, long[] output) { vectorCast(ZERO_EXTEND_S2L, SSPEC64, LSPEC128, input, output); } @@ -1562,7 +1563,7 @@ public static void runUS64toL128() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testUS64toL256(short[] input, long[] output) { vectorCast(ZERO_EXTEND_S2L, SSPEC64, LSPEC256, input, output); } @@ -1573,7 +1574,7 @@ public static void runUS64toL256() throws Throwable { } @Test - @IR(counts = {US2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_S2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testUS128toL512(short[] input, long[] output) { vectorCast(ZERO_EXTEND_S2L, SSPEC128, LSPEC512, input, output); } @@ -1584,7 +1585,7 @@ public static void runUS128toL512() throws Throwable { } @Test - @IR(counts = {UI2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_I2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUI64toL64(int[] input, long[] output) { vectorCast(ZERO_EXTEND_I2L, ISPEC64, LSPEC64, input, output); } @@ -1595,7 +1596,7 @@ public static void runUI64toL64() throws Throwable { } @Test - @IR(counts = {UI2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_I2L, IRNode.VECTOR_SIZE_2, "1"}) public static void testUI64toL128(int[] input, long[] output) { vectorCast(ZERO_EXTEND_I2L, ISPEC64, LSPEC128, input, output); } @@ -1606,7 +1607,7 @@ public static void runUI64toL128() throws Throwable { } @Test - @IR(counts = {UI2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_I2L, IRNode.VECTOR_SIZE_4, "1"}) public static void testUI128toL256(int[] input, long[] output) { vectorCast(ZERO_EXTEND_I2L, ISPEC128, LSPEC256, input, output); } @@ -1617,7 +1618,7 @@ public static void runUI128toL256() throws Throwable { } @Test - @IR(counts = {UI2X_NODE, "1"}) + @IR(counts = {IRNode.VECTOR_UCAST_I2L, IRNode.VECTOR_SIZE_8, "1"}) public static void testUI256toL512(int[] input, long[] output) { vectorCast(ZERO_EXTEND_I2L, ISPEC256, LSPEC512, input, output); } diff --git a/test/hotspot/jtreg/compiler/vectorapi/reshape/utils/VectorReshapeHelper.java b/test/hotspot/jtreg/compiler/vectorapi/reshape/utils/VectorReshapeHelper.java index 0349ae01871..349429b6c80 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/reshape/utils/VectorReshapeHelper.java +++ b/test/hotspot/jtreg/compiler/vectorapi/reshape/utils/VectorReshapeHelper.java @@ -71,15 +71,6 @@ public class VectorReshapeHelper { public static final VectorSpecies FSPEC512 = FloatVector.SPECIES_512; public static final VectorSpecies DSPEC512 = DoubleVector.SPECIES_512; - public static final String B2X_NODE = IRNode.VECTOR_CAST_B2X; - public static final String S2X_NODE = IRNode.VECTOR_CAST_S2X; - public static final String I2X_NODE = IRNode.VECTOR_CAST_I2X; - public static final String L2X_NODE = IRNode.VECTOR_CAST_L2X; - public static final String F2X_NODE = IRNode.VECTOR_CAST_F2X; - public static final String D2X_NODE = IRNode.VECTOR_CAST_D2X; - public static final String UB2X_NODE = IRNode.VECTOR_UCAST_B2X; - public static final String US2X_NODE = IRNode.VECTOR_UCAST_S2X; - public static final String UI2X_NODE = IRNode.VECTOR_UCAST_I2X; public static final String REINTERPRET_NODE = IRNode.VECTOR_REINTERPRET; public static void runMainHelper(Class testClass, Stream testMethods, String... flags) { diff --git a/test/hotspot/jtreg/compiler/vectorization/TestAutoVecIntMinMax.java b/test/hotspot/jtreg/compiler/vectorization/TestAutoVecIntMinMax.java index e15a4c834cd..e3baed37804 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestAutoVecIntMinMax.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestAutoVecIntMinMax.java @@ -62,8 +62,8 @@ public static void main(String[] args) { // Test for auto-vectorization of Math.min operation on an array of integers @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) - @IR(counts = {IRNode.MIN_V, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) + @IR(counts = {IRNode.MIN_VI, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testIntMin(int[] a, int[] b) { for(int i = 0; i < LENGTH; i++) { @@ -73,8 +73,8 @@ private static void testIntMin(int[] a, int[] b) { // Test for auto-vectorization of StrictMath.min operation on an array of integers @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) - @IR(counts = {IRNode.MIN_V, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) + @IR(counts = {IRNode.MIN_VI, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testIntStrictMin(int[] a, int[] b) { for(int i = 0; i < LENGTH; i++) { @@ -84,8 +84,8 @@ private static void testIntStrictMin(int[] a, int[] b) { // Test for auto-vectorization of Math.max operation on an array of integers @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) - @IR(counts = {IRNode.MAX_V, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) + @IR(counts = {IRNode.MAX_VI, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testIntMax(int[] a, int[] b) { for(int i = 0; i < LENGTH; i++) { @@ -95,8 +95,8 @@ private static void testIntMax(int[] a, int[] b) { // Test for auto-vectorization of StrictMath.max operation on an array of integers @Test - @IR(counts = {IRNode.LOAD_VECTOR, " >0 "}) - @IR(counts = {IRNode.MAX_V, " >0 "}) + @IR(counts = {IRNode.LOAD_VECTOR_I, " >0 "}) + @IR(counts = {IRNode.MAX_VI, " >0 "}) @IR(counts = {IRNode.STORE_VECTOR, " >0 "}) private static void testIntStrictMax(int[] a, int[] b) { for(int i = 0; i < LENGTH; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVector.java b/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVector.java index 186f829f18f..49035332fa4 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVector.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVector.java @@ -51,7 +51,7 @@ public static void main(String args[]) { } @Test - @IR(counts = {IRNode.VECTOR_CAST_F2HF, "> 0"}) + @IR(counts = {IRNode.VECTOR_CAST_F2HF, IRNode.VECTOR_SIZE + "min(max_float, max_short)", "> 0"}) public void test_float_float16(short[] sout, float[] finp) { for (int i = 0; i < finp.length; i++) { sout[i] = Float.floatToFloat16(finp[i]); @@ -94,7 +94,7 @@ public void kernel_test_float_float16() { } @Test - @IR(counts = {IRNode.VECTOR_CAST_HF2F, "> 0"}) + @IR(counts = {IRNode.VECTOR_CAST_HF2F, IRNode.VECTOR_SIZE + "min(max_float, max_short)", "> 0"}) public void test_float16_float(float[] fout, short[] sinp) { for (int i = 0; i < sinp.length; i++) { fout[i] = Float.float16ToFloat(sinp[i]); diff --git a/test/hotspot/jtreg/compiler/vectorization/TestOptionVectorizeIR.java b/test/hotspot/jtreg/compiler/vectorization/TestOptionVectorizeIR.java index 8c5217c1d51..7d100704013 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestOptionVectorizeIR.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestOptionVectorizeIR.java @@ -34,8 +34,8 @@ import compiler.lib.ir_framework.*; public class TestOptionVectorizeIR { - static final int RANGE = 512; - static final int ITER = 100; + static int RANGE = 1024*2; + static int ITER = 100; int[] gold1 = new int[RANGE]; int[] gold2 = new int[RANGE]; int[] gold3 = new int[RANGE]; @@ -220,7 +220,7 @@ static void test1(int[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test2(int[] data) { @@ -231,7 +231,7 @@ static void test2(int[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.REPLICATE_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0", IRNode.REPLICATE_I, "> 0", IRNode.ADD_VI, "> 0", IRNode.MUL_VI, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test3(int[] data, int A, int B) { @@ -273,7 +273,7 @@ static void test6(int[] data) { // ------------------------- Long ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test10(long[] data) { @@ -283,7 +283,7 @@ static void test10(long[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_L, "> 0", IRNode.ADD_VL, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test11(long[] data) { @@ -347,7 +347,7 @@ public void runTest13() { // ------------------------- Short ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.ADD_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test20(short[] data) { @@ -357,7 +357,7 @@ static void test20(short[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_S, "> 0", IRNode.ADD_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test21(short[] data) { @@ -420,7 +420,7 @@ public void runTest23() { // ------------------------- Byte ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.ADD_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test30(byte[] data) { @@ -430,7 +430,7 @@ static void test30(byte[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_B, "> 0", IRNode.ADD_VB, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test31(byte[] data) { @@ -493,7 +493,7 @@ public void runTest33() { // ------------------------- Char ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.ADD_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test40(char[] data) { @@ -503,7 +503,7 @@ static void test40(char[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_C, "> 0", IRNode.ADD_VS, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test41(char[] data) { @@ -565,7 +565,7 @@ public void runTest43() { // ------------------------- Float ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.ADD_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test50(float[] data) { @@ -575,7 +575,7 @@ static void test50(float[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0", IRNode.ADD_VF, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test51(float[] data) { @@ -637,7 +637,7 @@ public void runTest53() { // ------------------------- Double ----------------------------- @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.ADD_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test60(double[] data) { @@ -647,7 +647,7 @@ static void test60(double[] data) { } @Test - @IR(counts = {IRNode.LOAD_VECTOR, "> 0", IRNode.ADD_V, "> 0", IRNode.STORE_VECTOR, "> 0"}, + @IR(counts = {IRNode.LOAD_VECTOR_D, "> 0", IRNode.ADD_VD, "> 0", IRNode.STORE_VECTOR, "> 0"}, applyIf = {"AlignVector", "false"}, applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"}) static void test61(double[] data) { diff --git a/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java b/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java index a30015d73f8..1144186d8e5 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java @@ -73,7 +73,7 @@ public static void main(String args[]) { } @Test - @IR(counts = {IRNode.REVERSE_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_VL, "> 0"}) public void test_reverse_long1(long[] lout, long[] linp) { for (int i = 0; i < lout.length; i+=1) { lout[i] = Long.reverse(linp[i]); @@ -89,7 +89,7 @@ public void kernel_test_reverse_long1() { } @Test - @IR(failOn = {IRNode.REVERSE_V, IRNode.REVERSE_L}) + @IR(failOn = {IRNode.REVERSE_VL, IRNode.REVERSE_L}) public void test_reverse_long2(long[] lout, long[] linp) { for (int i = 0; i < lout.length; i+=1) { lout[i] = Long.reverse(Long.reverse(linp[i])); @@ -105,7 +105,7 @@ public void kernel_test_reverse_long2() { } @Test - @IR(failOn = {IRNode.REVERSE_V, IRNode.REVERSE_L}) + @IR(failOn = {IRNode.REVERSE_VL, IRNode.REVERSE_L}) public void test_reverse_long3(long[] lout, long[] linp) { for (int i = 0; i < lout.length; i+=1) { lout[i] = Long.reverse(linp[i] ^ linp[i]); @@ -121,7 +121,7 @@ public void kernel_test_reverse_long3() { } @Test - @IR(counts = {IRNode.REVERSE_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_VI, "> 0"}) public void test_reverse_int1(int[] iout, int[] iinp) { for (int i = 0; i < iout.length; i+=1) { iout[i] = Integer.reverse(iinp[i]); @@ -137,7 +137,7 @@ public void kernel_test_reverse_int1() { } @Test - @IR(failOn = {IRNode.REVERSE_V, IRNode.REVERSE_I}) + @IR(failOn = {IRNode.REVERSE_VI, IRNode.REVERSE_I}) public void test_reverse_int2(int[] iout, int[] iinp) { for (int i = 0; i < iout.length; i+=1) { iout[i] = Integer.reverse(Integer.reverse(iinp[i])); @@ -153,7 +153,7 @@ public void kernel_test_reverse_int2() { } @Test - @IR(failOn = {IRNode.REVERSE_V, IRNode.REVERSE_I}) + @IR(failOn = {IRNode.REVERSE_VI, IRNode.REVERSE_I}) public void test_reverse_int3(int[] iout, int[] iinp) { for (int i = 0; i < iout.length; i+=1) { iout[i] = Integer.reverse(iinp[i] ^ iinp[i]); diff --git a/test/hotspot/jtreg/compiler/vectorization/TestReverseBytes.java b/test/hotspot/jtreg/compiler/vectorization/TestReverseBytes.java index 2d399fbd274..47813e2790e 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestReverseBytes.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestReverseBytes.java @@ -74,7 +74,7 @@ public static void main(String args[]) { } @Test - @IR(counts = {IRNode.REVERSE_BYTES_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_BYTES_VL, "> 0"}) public void test_reverse_bytes_long(long[] lout, long[] linp) { for (int i = 0; i < lout.length; i+=1) { lout[i] = Long.reverseBytes(linp[i]); @@ -90,7 +90,7 @@ public void kernel_test_reverse_bytes_long() { } @Test - @IR(counts = {IRNode.REVERSE_BYTES_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_BYTES_VI, "> 0"}) public void test_reverse_bytes_int(int[] iout, int[] iinp) { for (int i = 0; i < iout.length; i+=1) { iout[i] = Integer.reverseBytes(iinp[i]); @@ -106,7 +106,7 @@ public void kernel_test_reverse_bytes_int() { } @Test - @IR(counts = {IRNode.REVERSE_BYTES_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_BYTES_VS, "> 0"}) public void test_reverse_bytes_short(short[] sout, short[] sinp) { for (int i = 0; i < sout.length; i+=1) { sout[i] = Short.reverseBytes(sinp[i]); @@ -122,7 +122,7 @@ public void kernel_test_reverse_bytes_short() { } @Test - @IR(counts = {IRNode.REVERSE_BYTES_V, "> 0"}) + @IR(counts = {IRNode.REVERSE_BYTES_VS, "> 0"}) public void test_reverse_bytes_char(char[] cout, char[] cinp) { for (int i = 0; i < cout.length; i+=1) { cout[i] = Character.reverseBytes(cinp[i]); diff --git a/test/hotspot/jtreg/compiler/vectorization/TestSubwordReverseBytes.java b/test/hotspot/jtreg/compiler/vectorization/TestSubwordReverseBytes.java index 69e97e5c0ef..d1baf7fae4d 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestSubwordReverseBytes.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestSubwordReverseBytes.java @@ -54,7 +54,7 @@ public class TestSubwordReverseBytes { } @Test - @IR(failOn = {IRNode.REVERSE_BYTES_V}) + @IR(failOn = {IRNode.REVERSE_BYTES_VS}) public static int[] testShortReverseBytes() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -75,7 +75,7 @@ public static void testShort() { } @Test - @IR(failOn = {IRNode.REVERSE_BYTES_V}) + @IR(failOn = {IRNode.REVERSE_BYTES_VS}) public static int[] testCharacterReverseBytes() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java index 1d73221a549..0d53c748979 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayShiftOpTest.java @@ -98,7 +98,7 @@ public long[] longCombinedRotateShift() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VI, ">0"}) public int[] intShiftLargeDistConstant() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -109,7 +109,7 @@ public int[] intShiftLargeDistConstant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VI, ">0"}) public int[] intShiftLargeDistInvariant() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -120,7 +120,7 @@ public int[] intShiftLargeDistInvariant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] shortShiftLargeDistConstant() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +131,7 @@ public short[] shortShiftLargeDistConstant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] shortShiftLargeDistInvariant() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -142,7 +142,7 @@ public short[] shortShiftLargeDistInvariant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VL, ">0"}) public long[] longShiftLargeDistConstant() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -153,7 +153,7 @@ public long[] longShiftLargeDistConstant() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VL, ">0"}) public long[] longShiftLargeDistInvariant() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -186,7 +186,7 @@ public short[] loopIndexShiftDistance() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] vectorUnsignedShiftRight() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java index f7f3dc39431..a4640bbc302 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/ArrayTypeConvertTest.java @@ -132,7 +132,7 @@ public byte[] NarrowToByte() { // ---------------- Convert I/L to F/D ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.VECTOR_CAST_I2X, ">0"}) + counts = {IRNode.VECTOR_CAST_I2F, IRNode.VECTOR_SIZE + "min(max_int, max_float)", ">0"}) public float[] convertIntToFloat() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -146,7 +146,7 @@ public float[] convertIntToFloat() { // The vectorization of some conversions may fail when `+AlignVector`. // We can remove the condition after JDK-8303827. applyIf = {"AlignVector", "false"}, - counts = {IRNode.VECTOR_CAST_I2X, ">0"}) + counts = {IRNode.VECTOR_CAST_I2D, IRNode.VECTOR_SIZE + "min(max_int, max_double)", ">0"}) public double[] convertIntToDouble() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -157,7 +157,7 @@ public double[] convertIntToDouble() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx512dq", "true"}, - counts = {IRNode.VECTOR_CAST_L2X, ">0"}) + counts = {IRNode.VECTOR_CAST_L2F, IRNode.VECTOR_SIZE + "min(max_long, max_float)", ">0"}) public float[] convertLongToFloat() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -168,7 +168,7 @@ public float[] convertLongToFloat() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx512dq", "true"}, - counts = {IRNode.VECTOR_CAST_L2X, ">0"}) + counts = {IRNode.VECTOR_CAST_L2D, IRNode.VECTOR_SIZE + "min(max_long, max_double)", ">0"}) public double[] convertLongToDouble() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -180,7 +180,7 @@ public double[] convertLongToDouble() { // ---------------- Convert Subword-I to F/D ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.VECTOR_CAST_S2X, ">0"}) + counts = {IRNode.VECTOR_CAST_S2F, IRNode.VECTOR_SIZE + "min(max_short, max_float)", ">0"}) public float[] convertShortToFloat() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -192,7 +192,7 @@ public float[] convertShortToFloat() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, applyIf = {"MaxVectorSize", ">=32"}, - counts = {IRNode.VECTOR_CAST_S2X, ">0"}) + counts = {IRNode.VECTOR_CAST_S2D, IRNode.VECTOR_SIZE + "min(max_short, max_double)", ">0"}) public double[] convertShortToDouble() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -222,7 +222,7 @@ public double[] convertCharToDouble() { // ---------------- Convert F/D to I/L ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2I, IRNode.VECTOR_SIZE + "min(max_float, max_int)", ">0"}) public int[] convertFloatToInt() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -236,7 +236,7 @@ public int[] convertFloatToInt() { // The vectorization of some conversions may fail when `+AlignVector`. // We can remove the condition after JDK-8303827. applyIf = {"AlignVector", "false"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2L, IRNode.VECTOR_SIZE + "min(max_float, max_long)", ">0"}) public long[] convertFloatToLong() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -247,7 +247,7 @@ public long[] convertFloatToLong() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx", "true"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2I, IRNode.VECTOR_SIZE + "min(max_double, max_int)", ">0"}) public int[] convertDoubleToInt() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -258,7 +258,7 @@ public int[] convertDoubleToInt() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx512dq", "true"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2L, IRNode.VECTOR_SIZE + "min(max_double, max_long)", ">0"}) public long[] convertDoubleToLong() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -270,7 +270,7 @@ public long[] convertDoubleToLong() { // ---------------- Convert F/D to Subword-I ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE + "min(max_float, max_short)", ">0"}) public short[] convertFloatToShort() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -281,7 +281,7 @@ public short[] convertFloatToShort() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2S, IRNode.VECTOR_SIZE + "min(max_float, max_char)", ">0"}) public char[] convertFloatToChar() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -293,7 +293,7 @@ public char[] convertFloatToChar() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx", "true"}, applyIf = {"MaxVectorSize", ">=32"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE + "min(max_double, max_short)", ">0"}) public short[] convertDoubleToShort() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -305,7 +305,7 @@ public short[] convertDoubleToShort() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx", "true"}, applyIf = {"MaxVectorSize", ">=32"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2S, IRNode.VECTOR_SIZE + "min(max_double, max_char)", ">0"}) public char[] convertDoubleToChar() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -320,7 +320,7 @@ public char[] convertDoubleToChar() { // The vectorization of some conversions may fail when `+AlignVector`. // We can remove the condition after JDK-8303827. applyIf = {"AlignVector", "false"}, - counts = {IRNode.VECTOR_CAST_F2X, ">0"}) + counts = {IRNode.VECTOR_CAST_F2D, IRNode.VECTOR_SIZE + "min(max_float, max_double)", ">0"}) public double[] convertFloatToDouble() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -331,7 +331,7 @@ public double[] convertFloatToDouble() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.VECTOR_CAST_D2X, ">0"}) + counts = {IRNode.VECTOR_CAST_D2F, IRNode.VECTOR_SIZE + "min(max_double, max_float)", ">0"}) public float[] convertDoubleToFloat() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java index b4c5108c631..e1d30a5c839 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicBooleanOpTest.java @@ -44,7 +44,7 @@ public class BasicBooleanOpTest extends VectorizationTestRunner { - private static final int SIZE = 543; + private static final int SIZE = 6543; private boolean[] a; private boolean[] b; @@ -72,9 +72,9 @@ public boolean[] vectorNot() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VB, ">0"}) @IR(applyIfCPUFeatureAnd = {"avx512f", "false", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VB, ">0"}) @IR(applyIfCPUFeature = {"avx512f", "true"}, counts = {IRNode.MACRO_LOGIC_V, ">0"}) public boolean[] vectorAnd() { @@ -87,7 +87,7 @@ public boolean[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VB, ">0"}) public boolean[] vectorOr() { boolean[] res = new boolean[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -98,7 +98,7 @@ public boolean[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VB, ">0"}) public boolean[] vectorXor() { boolean[] res = new boolean[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java index 03716157ca6..1ed615317d1 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicByteOpTest.java @@ -34,6 +34,8 @@ * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI + * -XX:CompileCommand=CompileOnly,compiler.vectorization.runner.BasicByteOpTest::* + * -XX:LoopUnrollLimit=1000 * compiler.vectorization.runner.BasicByteOpTest * * @requires vm.compiler2.enabled & vm.flagless @@ -45,7 +47,7 @@ public class BasicByteOpTest extends VectorizationTestRunner { - private static final int SIZE = 543; + private static int SIZE = 6543; private byte[] a; private byte[] b; @@ -65,7 +67,7 @@ public BasicByteOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VB, ">0"}) public byte[] vectorNeg() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -76,7 +78,7 @@ public byte[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "ssse3", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VB, ">0"}) public byte[] vectorAbs() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -87,7 +89,7 @@ public byte[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VB, ">0"}) public byte[] vectorAdd() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -98,7 +100,7 @@ public byte[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VB, ">0"}) public byte[] vectorSub() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -109,7 +111,7 @@ public byte[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VB, ">0"}) public byte[] vectorMul() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -120,7 +122,7 @@ public byte[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.ADD_V, ">0"}) + counts = {IRNode.MUL_VB, ">0", IRNode.ADD_VB, ">0"}) public byte[] vectorMulAdd() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +133,7 @@ public byte[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VB, ">0", IRNode.SUB_VB, ">0"}) public byte[] vectorMulSub() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -143,7 +145,7 @@ public byte[] vectorMulSub() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VB, ">0"}) public byte[] vectorNot() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -154,7 +156,7 @@ public byte[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VB, ">0"}) public byte[] vectorAnd() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -165,7 +167,7 @@ public byte[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VB, ">0"}) public byte[] vectorOr() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -176,7 +178,7 @@ public byte[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VB, ">0"}) public byte[] vectorXor() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -188,7 +190,7 @@ public byte[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VB, ">0"}) public byte[] vectorShiftLeft() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -199,7 +201,7 @@ public byte[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VB, ">0"}) public byte[] vectorSignedShiftRight() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -210,7 +212,7 @@ public byte[] vectorSignedShiftRight() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VB, ">0"}) public byte[] vectorUnsignedShiftRight() { byte[] res = new byte[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java index e43f5c888a6..4b91360fc54 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicCharOpTest.java @@ -67,7 +67,7 @@ public BasicCharOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VS, ">0"}) public char[] vectorNeg() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -79,7 +79,7 @@ public char[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "ssse3", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) - @IR(failOn = {IRNode.ABS_V}) + @IR(failOn = {IRNode.ABS_VI, IRNode.ABS_VB, IRNode.ABS_VL}) // AVS_VC does not exist public char[] vectorAbs() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -90,7 +90,7 @@ public char[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VS, ">0"}) // char add same as for short public char[] vectorAdd() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -101,7 +101,7 @@ public char[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VS, ">0"}) public char[] vectorSub() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -112,7 +112,7 @@ public char[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VS, ">0"}) public char[] vectorMul() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -123,7 +123,8 @@ public char[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.ADD_V, ">0"}) + counts = {IRNode.MUL_VS, ">0", + IRNode.ADD_VS, ">0"}) // char add same as for short public char[] vectorMulAdd() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -134,7 +135,7 @@ public char[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VS, ">0", IRNode.SUB_VS, ">0"}) public char[] vectorMulSub() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -146,7 +147,7 @@ public char[] vectorMulSub() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VS, ">0"}) public char[] vectorNot() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -157,7 +158,7 @@ public char[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VS, ">0"}) public char[] vectorAnd() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -168,7 +169,7 @@ public char[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VS, ">0"}) public char[] vectorOr() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -179,7 +180,7 @@ public char[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VS, ">0"}) public char[] vectorXor() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -191,7 +192,7 @@ public char[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VC, ">0"}) public char[] vectorShiftLeft() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -202,7 +203,7 @@ public char[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VC, ">0"}) public char[] vectorSignedShiftRight() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -213,7 +214,7 @@ public char[] vectorSignedShiftRight() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VC, ">0"}) public char[] vectorUnsignedShiftRight() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -225,7 +226,7 @@ public char[] vectorUnsignedShiftRight() { // ------------- ReverseBytes ------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.REVERSE_BYTES_V, ">0"}) + counts = {IRNode.REVERSE_BYTES_VS, ">0"}) public char[] reverseBytesWithChar() { char[] res = new char[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java index 60dc8a5e148..cddeee1d351 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicDoubleOpTest.java @@ -65,7 +65,7 @@ public BasicDoubleOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.NEG_V, ">0"}) + counts = {IRNode.NEG_VD, ">0"}) public double[] vectorNeg() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -76,7 +76,7 @@ public double[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VD, ">0"}) public double[] vectorAbs() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -87,7 +87,7 @@ public double[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.SQRT_V, ">0"}) + counts = {IRNode.SQRT_VD, ">0"}) public double[] vectorSqrt() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +131,7 @@ public double[] vectorRint() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VD, ">0"}) public double[] vectorAdd() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -142,7 +142,7 @@ public double[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VD, ">0"}) public double[] vectorSub() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -153,7 +153,7 @@ public double[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VD, ">0"}) public double[] vectorMul() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -164,7 +164,7 @@ public double[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.DIV_V, ">0"}) + counts = {IRNode.DIV_VD, ">0"}) public double[] vectorDiv() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -175,7 +175,7 @@ public double[] vectorDiv() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.MAX_V, ">0"}) + counts = {IRNode.MAX_VD, ">0"}) public double[] vectorMax() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -186,7 +186,7 @@ public double[] vectorMax() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.MIN_V, ">0"}) + counts = {IRNode.MIN_VD, ">0"}) public double[] vectorMin() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -197,9 +197,9 @@ public double[] vectorMin() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0", IRNode.VFMLA, ">0"}) + counts = {IRNode.FMA_VD, ">0", IRNode.VFMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorMulAdd() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -210,9 +210,9 @@ public double[] vectorMulAdd() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0", IRNode.VFMLS, ">0"}) + counts = {IRNode.FMA_VD, ">0", IRNode.VFMLS, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorMulSub1() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -223,9 +223,9 @@ public double[] vectorMulSub1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0", IRNode.VFMLS, ">0"}) + counts = {IRNode.FMA_VD, ">0", IRNode.VFMLS, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorMulSub2() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -236,11 +236,11 @@ public double[] vectorMulSub2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) @IR(applyIfCPUFeature = {"sve", "true"}, counts = {IRNode.VFNMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorNegateMulAdd1() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -251,11 +251,11 @@ public double[] vectorNegateMulAdd1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) @IR(applyIfCPUFeature = {"sve", "true"}, counts = {IRNode.VFNMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorNegateMulAdd2() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -266,9 +266,9 @@ public double[] vectorNegateMulAdd2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VD, ">0"}) public double[] vectorNegateMulSub() { double[] res = new double[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java index b52fb5a1364..3bd7bb2a15d 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicFloatOpTest.java @@ -65,7 +65,7 @@ public BasicFloatOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse", "true"}, - counts = {IRNode.NEG_V, ">0"}) + counts = {IRNode.NEG_VF, ">0"}) public float[] vectorNeg() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -76,7 +76,7 @@ public float[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VF, ">0"}) public float[] vectorAbs() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -87,7 +87,7 @@ public float[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.SQRT_V, ">0"}) + counts = {IRNode.SQRT_VF, ">0"}) public float[] vectorSqrt() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -98,7 +98,7 @@ public float[] vectorSqrt() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VF, ">0"}) public float[] vectorAdd() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -109,7 +109,7 @@ public float[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VF, ">0"}) public float[] vectorSub() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -120,7 +120,7 @@ public float[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VF, ">0"}) public float[] vectorMul() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +131,7 @@ public float[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.DIV_V, ">0"}) + counts = {IRNode.DIV_VF, ">0"}) public float[] vectorDiv() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -142,7 +142,7 @@ public float[] vectorDiv() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.MAX_V, ">0"}) + counts = {IRNode.MAX_VF, ">0"}) public float[] vectorMax() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -153,7 +153,7 @@ public float[] vectorMax() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx", "true"}, - counts = {IRNode.MIN_V, ">0"}) + counts = {IRNode.MIN_VF, ">0"}) public float[] vectorMin() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -164,9 +164,9 @@ public float[] vectorMin() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0", IRNode.VFMLA, ">0"}) + counts = {IRNode.FMA_VF, ">0", IRNode.VFMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorMulAdd() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -177,9 +177,9 @@ public float[] vectorMulAdd() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0", IRNode.VFMLS, ">0"}) + counts = {IRNode.FMA_VF, ">0", IRNode.VFMLS, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorMulSub1() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -190,9 +190,9 @@ public float[] vectorMulSub1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0", IRNode.VFMLS, ">0"}) + counts = {IRNode.FMA_VF, ">0", IRNode.VFMLS, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorMulSub2() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -203,11 +203,11 @@ public float[] vectorMulSub2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) @IR(applyIfCPUFeature = {"sve", "true"}, counts = {IRNode.VFNMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorNegateMulAdd1() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -218,11 +218,11 @@ public float[] vectorNegateMulAdd1() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) @IR(applyIfCPUFeature = {"sve", "true"}, counts = {IRNode.VFNMLA, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorNegateMulAdd2() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -233,9 +233,9 @@ public float[] vectorNegateMulAdd2() { @Test @IR(applyIfCPUFeature = {"asimd", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) @IR(applyIfCPUFeatureAnd = {"fma", "true", "avx", "true"}, - counts = {IRNode.FMA_V, ">0"}) + counts = {IRNode.FMA_VF, ">0"}) public float[] vectorNegateMulSub() { float[] res = new float[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java index 4d86cd11345..d392214c969 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicIntOpTest.java @@ -65,7 +65,7 @@ public BasicIntOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VI, ">0"}) public int[] vectorNeg() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -76,7 +76,7 @@ public int[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "ssse3", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VI, ">0"}) public int[] vectorAbs() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -87,7 +87,7 @@ public int[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VI, ">0"}) public int[] vectorAdd() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -98,7 +98,7 @@ public int[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VI, ">0"}) public int[] vectorSub() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -109,7 +109,7 @@ public int[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] vectorMul() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -120,7 +120,7 @@ public int[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.ADD_V, ">0"}) + counts = {IRNode.MUL_VI, ">0", IRNode.ADD_VI, ">0"}) public int[] vectorMulAdd() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -131,7 +131,7 @@ public int[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VI, ">0", IRNode.SUB_VI, ">0"}) public int[] vectorMulSub() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -154,7 +154,7 @@ public int[] vectorPopCount() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VI, ">0"}) public int[] vectorNot() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -165,7 +165,7 @@ public int[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VI, ">0"}) public int[] vectorAnd() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -176,7 +176,7 @@ public int[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VI, ">0"}) public int[] vectorOr() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -187,7 +187,7 @@ public int[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VI, ">0"}) public int[] vectorXor() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -199,7 +199,7 @@ public int[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VI, ">0"}) public int[] vectorShiftLeft() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -210,7 +210,7 @@ public int[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VI, ">0"}) public int[] vectorSignedShiftRight() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -221,7 +221,7 @@ public int[] vectorSignedShiftRight() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VI, ">0"}) public int[] vectorUnsignedShiftRight() { int[] res = new int[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java index 8adce9eceff..1e41ae97ea2 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicLongOpTest.java @@ -66,7 +66,7 @@ public BasicLongOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VL, ">0"}) public long[] vectorNeg() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -77,7 +77,7 @@ public long[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx512vl", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VL, ">0"}) public long[] vectorAbs() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -88,7 +88,7 @@ public long[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VL, ">0"}) public long[] vectorAdd() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -99,7 +99,7 @@ public long[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VL, ">0"}) public long[] vectorSub() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -110,7 +110,7 @@ public long[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx512dq", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VL, ">0"}) public long[] vectorMul() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -121,9 +121,9 @@ public long[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "sse4.1", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VL, ">0"}) @IR(applyIfCPUFeatureOr = {"sve", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VL, ">0"}) public long[] vectorMulAdd() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -134,7 +134,7 @@ public long[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VL, ">0", IRNode.SUB_VL, ">0"}) public long[] vectorMulSub() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -146,7 +146,7 @@ public long[] vectorMulSub() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VL, ">0"}) public long[] vectorNot() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -157,7 +157,7 @@ public long[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VL, ">0"}) public long[] vectorAnd() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -168,7 +168,7 @@ public long[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VL, ">0"}) public long[] vectorOr() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -179,7 +179,7 @@ public long[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VL, ">0"}) public long[] vectorXor() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -191,7 +191,7 @@ public long[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VL, ">0"}) public long[] vectorShiftLeft() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -202,7 +202,7 @@ public long[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VL, ">0"}) public long[] vectorSignedShiftRight() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -213,7 +213,7 @@ public long[] vectorSignedShiftRight() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.URSHIFT_V, ">0"}) + counts = {IRNode.URSHIFT_VL, ">0"}) public long[] vectorUnsignedShiftRight() { long[] res = new long[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java index b2a096758bc..b47267e5507 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/BasicShortOpTest.java @@ -67,7 +67,7 @@ public BasicShortOpTest() { // ---------------- Arithmetic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VS, ">0"}) public short[] vectorNeg() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -78,7 +78,7 @@ public short[] vectorNeg() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "ssse3", "true"}, - counts = {IRNode.ABS_V, ">0"}) + counts = {IRNode.ABS_VS, ">0"}) public short[] vectorAbs() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -89,7 +89,7 @@ public short[] vectorAbs() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.ADD_V, ">0"}) + counts = {IRNode.ADD_VS, ">0"}) public short[] vectorAdd() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -100,7 +100,7 @@ public short[] vectorAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VS, ">0"}) public short[] vectorSub() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -111,7 +111,7 @@ public short[] vectorSub() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VS, ">0"}) public short[] vectorMul() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -122,7 +122,7 @@ public short[] vectorMul() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.ADD_V, ">0"}) + counts = {IRNode.MUL_VS, ">0", IRNode.ADD_VS, ">0"}) public short[] vectorMulAdd() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -133,7 +133,7 @@ public short[] vectorMulAdd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.MUL_V, ">0", IRNode.SUB_V, ">0"}) + counts = {IRNode.MUL_VS, ">0", IRNode.SUB_VS, ">0"}) public short[] vectorMulSub() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -145,7 +145,7 @@ public short[] vectorMulSub() { // ---------------- Logic ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VS, ">0"}) public short[] vectorNot() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -156,7 +156,7 @@ public short[] vectorNot() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.AND_V, ">0"}) + counts = {IRNode.AND_VS, ">0"}) public short[] vectorAnd() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -167,7 +167,7 @@ public short[] vectorAnd() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.OR_V, ">0"}) + counts = {IRNode.OR_VS, ">0"}) public short[] vectorOr() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -178,7 +178,7 @@ public short[] vectorOr() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.XOR_V, ">0"}) + counts = {IRNode.XOR_VS, ">0"}) public short[] vectorXor() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -190,7 +190,7 @@ public short[] vectorXor() { // ---------------- Shift ---------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.LSHIFT_V, ">0"}) + counts = {IRNode.LSHIFT_VS, ">0"}) public short[] vectorShiftLeft() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -201,7 +201,7 @@ public short[] vectorShiftLeft() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] vectorSignedShiftRight() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -237,7 +237,7 @@ public short[] vectorMax() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.RSHIFT_V, ">0"}) + counts = {IRNode.RSHIFT_VS, ">0"}) public short[] vectorUnsignedShiftRight() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { @@ -249,7 +249,7 @@ public short[] vectorUnsignedShiftRight() { // ------------- ReverseBytes ------------- @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "avx2", "true"}, - counts = {IRNode.REVERSE_BYTES_V, ">0"}) + counts = {IRNode.REVERSE_BYTES_VS, ">0"}) public short[] reverseBytesWithShort() { short[] res = new short[SIZE]; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java index cc35213e5db..2ef686c2fd5 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java @@ -48,7 +48,7 @@ public class LoopArrayIndexComputeTest extends VectorizationTestRunner { - private static final int SIZE = 543; + private static final int SIZE = 6543; private int[] ints; private short[] shorts; @@ -95,7 +95,7 @@ public int[] indexPlusConstant() { @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] indexMinusConstant() { int[] res = new int[SIZE]; for (int i = SIZE / 2; i < SIZE; i++) { @@ -108,7 +108,7 @@ public int[] indexMinusConstant() { @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] indexPlusInvariant() { int[] res = new int[SIZE]; System.arraycopy(ints, 0, res, 0, SIZE); @@ -122,7 +122,7 @@ public int[] indexPlusInvariant() { @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] indexMinusInvariant() { int[] res = new int[SIZE]; System.arraycopy(ints, 0, res, 0, SIZE); @@ -136,7 +136,7 @@ public int[] indexMinusInvariant() { @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse4.1", "true"}, - counts = {IRNode.MUL_V, ">0"}) + counts = {IRNode.MUL_VI, ">0"}) public int[] indexWithInvariantAndConstant() { int[] res = new int[SIZE]; System.arraycopy(ints, 0, res, 0, SIZE); @@ -150,7 +150,7 @@ public int[] indexWithInvariantAndConstant() { @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, counts = {IRNode.STORE_VECTOR, ">0"}) @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true"}, - counts = {IRNode.SUB_V, ">0"}) + counts = {IRNode.SUB_VI, ">0"}) public int[] indexWithTwoInvariants() { int[] res = new int[SIZE]; System.arraycopy(ints, 0, res, 0, SIZE); diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java index 99f889ae74c..72667a66d82 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopReductionOpTest.java @@ -79,9 +79,8 @@ public LoopReductionOpTest() { @Test @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse3", "true"}, - counts = {IRNode.LOAD_VECTOR, ">0"}) - @IR(applyIfCPUFeatureOr = {"asimd", "true", "sse3", "true"}, - counts = {IRNode.ADD_REDUCTION_V, ">0"}) + counts = {IRNode.LOAD_VECTOR_I, ">0", + IRNode.ADD_REDUCTION_V, ">0"}) public int reductionAddSumOfArray() { int res = 0; for (int i = 0; i < SIZE; i++) { @@ -121,9 +120,8 @@ public int reductionAddLoopInv() { @Test @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, - counts = {IRNode.LOAD_VECTOR, ">0"}) - @IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"}, - counts = {IRNode.ADD_REDUCTION_V, ">0"}) + counts = {IRNode.LOAD_VECTOR_I, ">0", + IRNode.ADD_REDUCTION_V, ">0"}) public int reductionAddSumOfMultiple() { int res = 0; for (int i = 0; i < SIZE; i++) { diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java index 2c1a228f76f..539673a6c28 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java @@ -119,6 +119,109 @@ public void mixFailOnAndCounts() { public void compilePhases() { iFld = 42; } + + // Rules for vector nodes. + @Test + // By default, we search for the maximal size possible + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // We can also specify that we want the maximum explicitly + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE_MAX, "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Explicitly take the maximum size for this type (here int) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "max_for_type", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Exlicitly take the maximum size for the int type + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "max_int", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // As a last resort, we can match with any size + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE_ANY, "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Specify comma separated list of numbers, match for any of them + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "2,4,8,16,32,64", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Two or more arguments to min(...): the minimal value is applied + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_for_type, max_int, LoopMaxUnroll, 64)", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static int[] testVectorNode() { + int[] a = new int[1024*8]; + for (int i = 0; i < a.length; i++) { + a[i]++; + } + return a; + } + + // Rules for vector nodes. + @Test + // By default, we search for the maximal size possible + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // In some cases, we can know the exact size, here 16 + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_16, "> 0"}, + applyIf = {"MaxVectorSize", "=64"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_8, "> 0"}, + applyIf = {"MaxVectorSize", "=32"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // In some cases, we can know the exact size, here 4 + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_4, "> 0"}, + applyIf = {"MaxVectorSize", "=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static float[] testVectorNodeExactSize1() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length; i++) { + a[i]++; + } + return a; + } + + // Rules for vector nodes. Same as badTestVectorNodeSize but with good rules. + @Test + // In some cases, we can know the exact size, here 4 + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_4, "> 0"}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // Hence, we know any other sizes are impossible. + // We can also specify that explicitly for failOn + @IR(failOn = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_2, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_8, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_16, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_32, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE_64, + IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE + "2,8,16,32,64"}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static float[] testVectorNodeExactSize2() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length/8; i++) { + a[i*8 + 0]++; // block of 4, then gap of 4 + a[i*8 + 1]++; + a[i*8 + 2]++; + a[i*8 + 3]++; + } + return a; + } + + @Test + // Here, we can pack at most 8 given the 8-blocks and 8-gaps. + // But we can also never pack more than max_float + @IR(counts = {IRNode.LOAD_VECTOR_F, IRNode.VECTOR_SIZE + "min(8, max_float)", "> 0"}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static float[] testVectorNodeSizeMinClause() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length/16; i++) { + a[i*16 + 0]++; // block of 8, then gap of 8 + a[i*16 + 1]++; + a[i*16 + 2]++; + a[i*16 + 3]++; + a[i*16 + 4]++; + a[i*16 + 5]++; + a[i*16 + 6]++; + a[i*16 + 7]++; + } + return a; + } } class FailingExamples { @@ -194,4 +297,29 @@ public void testNotCompiled() { public void badStandAloneNotCompiled() { testNotCompiled(); } + + // Failing rules for vector nodes. Same as testVectorNodeExactSize2 but with bad rules. + @Test + // By default we look for the IRNode.VECTOR_SIZE_MAX, which is more than 4. + @IR(counts = {IRNode.LOAD_VECTOR_F, "> 0"}, + applyIf = {"MaxVectorSize", ">16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // By default, we look for IRNode.VECTOR_SIZE_ANY. But there are some of size 4. + @IR(failOn = {IRNode.LOAD_VECTOR_F}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + // By default, we look for IRNode.VECTOR_SIZE_ANY. But there are at least two of size 4. + @IR(counts = {IRNode.LOAD_VECTOR_F, "<2"}, + applyIf = {"MaxVectorSize", ">=16"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + static float[] badTestVectorNodeSize() { + float[] a = new float[1024*8]; + for (int i = 0; i < a.length/8; i++) { + a[i*8 + 0]++; // block of 4, then gap of 4 + a[i*8 + 1]++; + a[i*8 + 2]++; + a[i*8 + 3]++; + } + return a; + } } diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestBadFormat.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestBadFormat.java index 9dd605b3f65..c0d43f768f5 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestBadFormat.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestBadFormat.java @@ -999,7 +999,7 @@ public void emtpyUserProvidedPostfix() {} public void missingCountString() {} @Test - @FailCount(45) + @FailCount(51) @IR(counts = {IRNode.STORE, IRNode.STORE}) @IR(counts = {IRNode.STORE, IRNode.STORE, IRNode.STORE, IRNode.STORE}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", IRNode.STORE}) @@ -1025,6 +1025,12 @@ public void missingCountString() {} @IR(counts = {IRNode.STORE, " > 3.0"}) @IR(counts = {IRNode.STORE, " > a3"}) @IR(counts = {IRNode.STORE, " > 0x1"}) + @IR(counts = {IRNode.STORE, "!= 1000"}) + @IR(counts = {IRNode.STORE, "< 0"}) + @IR(counts = {IRNode.STORE, "< 1"}) + @IR(counts = {IRNode.STORE, "<= 0"}) + @IR(counts = {IRNode.STORE, "> -1"}) + @IR(counts = {IRNode.STORE, ">= 0"}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", "<"}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", "!"}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", "!3"}) @@ -1046,6 +1052,38 @@ public void missingCountString() {} @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", " > a3"}) @IR(counts = {IRNode.STORE_OF_CLASS, "Foo", " > 0x1"}) public void wrongCountString() {} + + @Test + @FailCount(8) + @IR(counts = {IRNode.LOAD_VECTOR_I, "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE_MAX, "> 0"}, // valid + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE_ANY, "> 0"}, // valid + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "xxx", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min()", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_for_type)", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "2,4,8,16,32,64,max_int", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "2,4,8,16,32,64,-3", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_for_type, xxx)", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + @IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_for_type, min(max_for_type, max_for_type))", "> 0"}, + applyIfCPUFeatureOr = {"sse2", "true", "asimd", "true"}) + public int[] badVectorNodeSize() { + int[] a = new int[1024*8]; + for (int i = 0; i < a.length; i++) { + a[i]++; + } + return a; + } } class BadIRNodeForPhase { @@ -1096,18 +1134,18 @@ public void loops() {} @Test @FailCount(6) - @IR(failOn = IRNode.LOAD_VECTOR, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works + @IR(failOn = IRNode.LOAD_VECTOR_I, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works @IR(failOn = IRNode.STORE_VECTOR, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works - @IR(failOn = IRNode.VECTOR_CAST_B2X, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works - @IR(failOn = IRNode.LOAD_VECTOR, phase = CompilePhase.BEFORE_MATCHING) // works + @IR(failOn = IRNode.VECTOR_CAST_B2I, phase = CompilePhase.BEFORE_REMOVEUSELESS) // works + @IR(failOn = IRNode.LOAD_VECTOR_I, phase = CompilePhase.BEFORE_MATCHING) // works @IR(failOn = IRNode.STORE_VECTOR, phase = CompilePhase.BEFORE_MATCHING) // works - @IR(failOn = IRNode.VECTOR_CAST_B2X, phase = CompilePhase.BEFORE_MATCHING) // works - @IR(failOn = IRNode.LOAD_VECTOR, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) + @IR(failOn = IRNode.VECTOR_CAST_B2I, phase = CompilePhase.BEFORE_MATCHING) // works + @IR(failOn = IRNode.LOAD_VECTOR_I, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) @IR(failOn = IRNode.STORE_VECTOR, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) - @IR(failOn = IRNode.VECTOR_CAST_B2X, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) - @IR(failOn = IRNode.LOAD_VECTOR, phase = CompilePhase.FINAL_CODE) + @IR(failOn = IRNode.VECTOR_CAST_B2I, phase = {CompilePhase.MATCHING, CompilePhase.MATCHING}) + @IR(failOn = IRNode.LOAD_VECTOR_I, phase = CompilePhase.FINAL_CODE) @IR(failOn = IRNode.STORE_VECTOR, phase = CompilePhase.FINAL_CODE) - @IR(failOn = IRNode.VECTOR_CAST_B2X, phase = CompilePhase.FINAL_CODE) + @IR(failOn = IRNode.VECTOR_CAST_B2I, phase = CompilePhase.FINAL_CODE) public void vector() {} @Test diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java index 5160ccb8e3b..4794a9c8127 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java @@ -100,12 +100,12 @@ public static void main(String[] args) { GoodFailOnRegexConstraint.create(MultipleFailOnBad.class, "fail10()", 1, 2, 3) ); - runCheck(BadCountsConstraint.create(BadCount.class, "bad1()", 1, 1, "Load"), + runCheck(BadCountsConstraint.create(BadCount.class, "bad1()", 1, 2, "Load"), GoodCountsConstraint.create(BadCount.class, "bad1()", 2), GoodCountsConstraint.create(BadCount.class, "bad2()", 1), - BadCountsConstraint.create(BadCount.class, "bad2()", 2, 1, "Store"), - BadCountsConstraint.create(BadCount.class, "bad3()", 1, 1, "Load"), - BadCountsConstraint.create(BadCount.class, "bad3()", 2, 1, "Store") + BadCountsConstraint.create(BadCount.class, "bad2()", 2, 2, "Store"), + BadCountsConstraint.create(BadCount.class, "bad3()", 1, 2, "Load"), + BadCountsConstraint.create(BadCount.class, "bad3()", 2, 2, "Store") ); runCheck(GoodRuleConstraint.create(Calls.class, "calls()", 1), @@ -629,10 +629,6 @@ class CountComparisons { IRNode.STORE, "<=1", IRNode.STORE, " <= 1", IRNode.STORE, " <= 1", - IRNode.STORE, "!= 0", - IRNode.STORE, "!=0", - IRNode.STORE, " != 0", - IRNode.STORE, " != 0", IRNode.STORE, "> 0", IRNode.STORE, ">0", IRNode.STORE, " > 0", @@ -823,27 +819,32 @@ public void good11() { class BadCount { int iFld; + int iFld2; int result; + int result2; @Test - @IR(counts = {IRNode.LOAD, "!= 1"}) // fail + @IR(counts = {IRNode.LOAD, "> 1000"}) // fail @IR(counts = {IRNode.STORE, "> 0"}) public void bad1() { result = iFld; + result2 = iFld2; } @Test - @IR(counts = {IRNode.LOAD, "1"}) // fail - @IR(counts = {IRNode.STORE, "< 1"}) + @IR(counts = {IRNode.LOAD, "2"}) // fail + @IR(counts = {IRNode.STORE, "< 2"}) public void bad2() { result = iFld; + result2 = iFld2; } @Test @IR(counts = {IRNode.LOAD, "0"}) // fail - @IR(counts = {IRNode.STORE, " <= 0"}) // fail + @IR(counts = {IRNode.STORE, " <= 1"}) // fail public void bad3() { result = iFld; + result2 = iFld2; } } diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSafepointWhilePrinting.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSafepointWhilePrinting.java index ee5ee38e331..99de3c1510c 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSafepointWhilePrinting.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSafepointWhilePrinting.java @@ -75,6 +75,15 @@ public void test() throws IOException { testCompilePhaseBackToBackFirst,1 testCompilePhaseBackToBackLast,1 ----- END ----- + ##### IRMatchingVMInfo - used by TestFramework ##### + : + cpuFeatures:empty_cpu_info + MaxVectorSize:64 + MaxVectorSizeIsDefault:1 + LoopMaxUnroll:64 + UseAVX:1 + UseAVXIsDefault:1 + ----- END VMInfo ----- """; TestClassParser testClassParser = new TestClassParser(TestSafepointWhilePrinting.class); Matchable testClassMatchable = testClassParser.parse(hotspotPidFileName, irEncoding); From 9ded86821b01d6d790850e9b49eedfc597c0c9a2 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 15 Aug 2023 11:05:31 +0000 Subject: [PATCH 056/162] 8314114: Fix -Wconversion warnings in os code, primarily linux Reviewed-by: dholmes, dlong --- src/hotspot/os/aix/attachListener_aix.cpp | 16 +-- src/hotspot/os/aix/os_aix.cpp | 4 +- src/hotspot/os/aix/os_perf_aix.cpp | 2 +- src/hotspot/os/bsd/attachListener_bsd.cpp | 18 ++-- src/hotspot/os/bsd/os_bsd.cpp | 4 +- src/hotspot/os/linux/attachListener_linux.cpp | 16 +-- src/hotspot/os/linux/os_linux.cpp | 100 +++++++++--------- src/hotspot/os/linux/os_perf_linux.cpp | 8 +- .../os/linux/systemMemoryBarrier_linux.cpp | 6 +- src/hotspot/os/linux/waitBarrier_linux.cpp | 14 +-- src/hotspot/os/posix/os_posix.cpp | 24 ++--- src/hotspot/os/posix/os_posix.hpp | 4 +- src/hotspot/os/posix/signals_posix.cpp | 8 +- src/hotspot/os/windows/os_windows.cpp | 10 +- src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp | 2 +- src/hotspot/share/runtime/os.hpp | 8 +- src/hotspot/share/utilities/ostream.cpp | 12 +-- src/hotspot/share/utilities/ostream.hpp | 2 +- 18 files changed, 130 insertions(+), 128 deletions(-) diff --git a/src/hotspot/os/aix/attachListener_aix.cpp b/src/hotspot/os/aix/attachListener_aix.cpp index 169e719668c..a02d337af46 100644 --- a/src/hotspot/os/aix/attachListener_aix.cpp +++ b/src/hotspot/os/aix/attachListener_aix.cpp @@ -108,7 +108,7 @@ class AixAttachListener: AllStatic { static bool is_shutdown() { return _shutdown; } // write the given buffer to a socket - static int write_fully(int s, char* buf, int len); + static int write_fully(int s, char* buf, size_t len); static AixAttachOperation* dequeue(); }; @@ -276,7 +276,7 @@ AixAttachOperation* AixAttachListener::read_request(int s) { // where is the protocol version (1), is the command // name ("load", "datadump", ...), and is an argument int expected_str_count = 2 + AttachOperation::arg_count_max; - const int max_len = (sizeof(ver_str) + 1) + (AttachOperation::name_length_max + 1) + + const size_t max_len = (sizeof(ver_str) + 1) + (AttachOperation::name_length_max + 1) + AttachOperation::arg_count_max*(AttachOperation::arg_length_max + 1); char buf[max_len]; @@ -285,15 +285,15 @@ AixAttachOperation* AixAttachListener::read_request(int s) { // Read until all (expected) strings have been read, the buffer is // full, or EOF. - int off = 0; - int left = max_len; + size_t off = 0; + size_t left = max_len; do { - int n; + ssize_t n; // Don't block on interrupts because this will // hang in the clean-up when shutting down. n = read(s, buf+off, left); - assert(n <= left, "buffer was too small, impossible!"); + assert(n <= checked_cast(left), "buffer was too small, impossible!"); buf[max_len - 1] = '\0'; if (n == -1) { return nullptr; // reset by peer or other error @@ -414,9 +414,9 @@ AixAttachOperation* AixAttachListener::dequeue() { } // write the given buffer to the socket -int AixAttachListener::write_fully(int s, char* buf, int len) { +int AixAttachListener::write_fully(int s, char* buf, size_t len) { do { - int n = ::write(s, buf, len); + ssize_t n = ::write(s, buf, len); if (n == -1) { if (errno != EINTR) return -1; } else { diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index 98b689d4530..8be210db83f 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -2985,7 +2985,7 @@ int os::get_core_path(char* buffer, size_t bufferSize) { jio_snprintf(buffer, bufferSize, "%s/core or core.%d", p, current_process_id()); - return strlen(buffer); + return checked_cast(strlen(buffer)); } bool os::start_debugging(char *buf, int buflen) { @@ -3023,7 +3023,7 @@ static inline time_t get_mtime(const char* filename) { int os::compare_file_modified_times(const char* file1, const char* file2) { time_t t1 = get_mtime(file1); time_t t2 = get_mtime(file2); - return t1 - t2; + return primitive_compare(t1, t2); } bool os::supports_map_sync() { diff --git a/src/hotspot/os/aix/os_perf_aix.cpp b/src/hotspot/os/aix/os_perf_aix.cpp index bdb70250a76..e1719df48c3 100644 --- a/src/hotspot/os/aix/os_perf_aix.cpp +++ b/src/hotspot/os/aix/os_perf_aix.cpp @@ -77,7 +77,7 @@ static bool read_psinfo(const u_longlong_t& pid, psinfo_t& psinfo) { FILE* fp; char buf[BUF_LENGTH]; - int len; + size_t len; jio_snprintf(buf, BUF_LENGTH, "/proc/%llu/psinfo", pid); fp = fopen(buf, "r"); diff --git a/src/hotspot/os/bsd/attachListener_bsd.cpp b/src/hotspot/os/bsd/attachListener_bsd.cpp index 589656288de..cf1ca453089 100644 --- a/src/hotspot/os/bsd/attachListener_bsd.cpp +++ b/src/hotspot/os/bsd/attachListener_bsd.cpp @@ -102,7 +102,7 @@ class BsdAttachListener: AllStatic { static int listener() { return _listener; } // write the given buffer to a socket - static int write_fully(int s, char* buf, int len); + static int write_fully(int s, char* buf, size_t len); static BsdAttachOperation* dequeue(); }; @@ -257,7 +257,7 @@ BsdAttachOperation* BsdAttachListener::read_request(int s) { // where is the protocol version (1), is the command // name ("load", "datadump", ...), and is an argument int expected_str_count = 2 + AttachOperation::arg_count_max; - const int max_len = (sizeof(ver_str) + 1) + (AttachOperation::name_length_max + 1) + + const size_t max_len = (sizeof(ver_str) + 1) + (AttachOperation::name_length_max + 1) + AttachOperation::arg_count_max*(AttachOperation::arg_length_max + 1); char buf[max_len]; @@ -266,13 +266,13 @@ BsdAttachOperation* BsdAttachListener::read_request(int s) { // Read until all (expected) strings have been read, the buffer is // full, or EOF. - int off = 0; - int left = max_len; + size_t off = 0; + size_t left = max_len; do { - int n; + ssize_t n; RESTARTABLE(read(s, buf+off, left), n); - assert(n <= left, "buffer was too small, impossible!"); + assert(n <= checked_cast(left), "buffer was too small, impossible!"); buf[max_len - 1] = '\0'; if (n == -1) { return nullptr; // reset by peer or other error @@ -280,7 +280,7 @@ BsdAttachOperation* BsdAttachListener::read_request(int s) { if (n == 0) { break; } - for (int i=0; i is the protocol version (1), is the command // name ("load", "datadump", ...), and is an argument int expected_str_count = 2 + AttachOperation::arg_count_max; - const int max_len = (sizeof(ver_str) + 1) + (AttachOperation::name_length_max + 1) + + const size_t max_len = (sizeof(ver_str) + 1) + (AttachOperation::name_length_max + 1) + AttachOperation::arg_count_max*(AttachOperation::arg_length_max + 1); char buf[max_len]; @@ -266,13 +266,13 @@ LinuxAttachOperation* LinuxAttachListener::read_request(int s) { // Read until all (expected) strings have been read, the buffer is // full, or EOF. - int off = 0; - int left = max_len; + size_t off = 0; + size_t left = max_len; do { - int n; + ssize_t n; RESTARTABLE(read(s, buf+off, left), n); - assert(n <= left, "buffer was too small, impossible!"); + assert(n <= checked_cast(left), "buffer was too small, impossible!"); buf[max_len - 1] = '\0'; if (n == -1) { return nullptr; // reset by peer or other error @@ -280,7 +280,7 @@ LinuxAttachOperation* LinuxAttachListener::read_request(int s) { if (n == 0) { break; } - for (int i=0; iosthread(); Monitor* sync = osthread->startThread_lock(); - osthread->set_thread_id(os::current_thread_id()); + osthread->set_thread_id(checked_cast(os::current_thread_id())); if (UseNUMA) { int lgrp_id = os::numa_get_group_id(); @@ -1265,7 +1265,7 @@ void os::Linux::capture_initial_stack(size_t max_size) { // by email from Hans Boehm. /proc/self/stat begins with current pid, // followed by command name surrounded by parentheses, state, etc. char stat[2048]; - int statlen; + size_t statlen; fp = os::fopen("/proc/self/stat", "r"); if (fp) { @@ -1474,7 +1474,7 @@ bool os::dll_address_to_function_name(address addr, char *buf, if (!(demangle && Decoder::demangle(dlinfo.dli_sname, buf, buflen))) { jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); } - if (offset != nullptr) *offset = addr - (address)dlinfo.dli_saddr; + if (offset != nullptr) *offset = pointer_delta_as_int(addr, (address)dlinfo.dli_saddr); return true; } // no matching symbol so try for just file info @@ -1502,7 +1502,7 @@ bool os::dll_address_to_library_name(address addr, char* buf, jio_snprintf(buf, buflen, "%s", dlinfo.dli_fname); } if (dlinfo.dli_fbase != nullptr && offset != nullptr) { - *offset = addr - (address)dlinfo.dli_fbase; + *offset = pointer_delta_as_int(addr, (address)dlinfo.dli_fbase); } return true; } @@ -1601,14 +1601,14 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) { } Elf32_Ehdr elf_head; - int diag_msg_max_length=ebuflen-strlen(ebuf); - char* diag_msg_buf=ebuf+strlen(ebuf); - - if (diag_msg_max_length==0) { + size_t prefix_len = strlen(ebuf); + ssize_t diag_msg_max_length = ebuflen - prefix_len; + if (diag_msg_max_length <= 0) { // No more space in ebuf for additional diagnostics message return nullptr; } + char* diag_msg_buf = ebuf + prefix_len; int file_descriptor= ::open(filename, O_RDONLY | O_NONBLOCK); @@ -1891,7 +1891,7 @@ static bool _print_ascii_file(const char* filename, outputStream* st, unsigned* } char buf[33]; - int bytes; + ssize_t bytes; buf[32] = '\0'; unsigned lines = 0; while ((bytes = ::read(fd, buf, sizeof(buf)-1)) > 0) { @@ -2382,7 +2382,7 @@ void os::Linux::print_steal_info(outputStream* st) { uint64_t total_ticks_difference = pticks.total - initial_total_ticks; double steal_ticks_perc = 0.0; if (total_ticks_difference != 0) { - steal_ticks_perc = (double) steal_ticks_difference / total_ticks_difference; + steal_ticks_perc = (double) steal_ticks_difference / (double)total_ticks_difference; } st->print_cr("Steal ticks since vm start: " UINT64_FORMAT, steal_ticks_difference); st->print_cr("Steal ticks percentage since vm start:%7.3f", steal_ticks_perc); @@ -2424,7 +2424,7 @@ static bool print_model_name_and_flags(outputStream* st, char* buf, size_t bufle if (fp) { bool model_name_printed = false; while (!feof(fp)) { - if (fgets(buf, buflen, fp)) { + if (fgets(buf, (int)buflen, fp)) { // Assume model name comes before flags if (strstr(buf, "model name") != nullptr) { if (!model_name_printed) { @@ -2667,7 +2667,7 @@ void os::jvm_path(char *buf, jint buflen) { // determine if this is a legacy image or modules image // modules image doesn't have "jre" subdirectory - len = strlen(buf); + len = checked_cast(strlen(buf)); assert(len < buflen, "Ran out of buffer room"); jrelib_p = buf + len; snprintf(jrelib_p, buflen-len, "/jre/lib"); @@ -2677,7 +2677,7 @@ void os::jvm_path(char *buf, jint buflen) { if (0 == access(buf, F_OK)) { // Use current module name "libjvm.so" - len = strlen(buf); + len = (int)strlen(buf); snprintf(buf + len, buflen-len, "/hotspot/libjvm.so"); } else { // Go back to path of .so @@ -2970,7 +2970,7 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, int os::Linux::sched_getcpu_syscall(void) { unsigned int cpu = 0; - int retval = -1; + long retval = -1; #if defined(IA32) #ifndef SYS_getcpu @@ -2989,7 +2989,7 @@ int os::Linux::sched_getcpu_syscall(void) { retval = vgetcpu(&cpu, nullptr, nullptr); #endif - return (retval == -1) ? retval : cpu; + return (retval == -1) ? -1 : cpu; } void os::Linux::sched_getcpu_init() { @@ -3142,30 +3142,30 @@ void os::Linux::rebuild_nindex_to_node_map() { // rebuild_cpu_to_node_map() constructs a table mapping cpud id to node id. // The table is later used in get_node_by_cpu(). void os::Linux::rebuild_cpu_to_node_map() { - const size_t NCPUS = 32768; // Since the buffer size computation is very obscure - // in libnuma (possible values are starting from 16, - // and continuing up with every other power of 2, but less - // than the maximum number of CPUs supported by kernel), and - // is a subject to change (in libnuma version 2 the requirements - // are more reasonable) we'll just hardcode the number they use - // in the library. - const size_t BitsPerCLong = sizeof(long) * CHAR_BIT; - - size_t cpu_num = processor_count(); - size_t cpu_map_size = NCPUS / BitsPerCLong; - size_t cpu_map_valid_size = + const int NCPUS = 32768; // Since the buffer size computation is very obscure + // in libnuma (possible values are starting from 16, + // and continuing up with every other power of 2, but less + // than the maximum number of CPUs supported by kernel), and + // is a subject to change (in libnuma version 2 the requirements + // are more reasonable) we'll just hardcode the number they use + // in the library. + constexpr int BitsPerCLong = (int)sizeof(long) * CHAR_BIT; + + int cpu_num = processor_count(); + int cpu_map_size = NCPUS / BitsPerCLong; + int cpu_map_valid_size = MIN2((cpu_num + BitsPerCLong - 1) / BitsPerCLong, cpu_map_size); cpu_to_node()->clear(); cpu_to_node()->at_grow(cpu_num - 1); - size_t node_num = get_existing_num_nodes(); + int node_num = get_existing_num_nodes(); int distance = 0; int closest_distance = INT_MAX; int closest_node = 0; unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size, mtInternal); - for (size_t i = 0; i < node_num; i++) { + for (int i = 0; i < node_num; i++) { // Check if node is configured (not a memory-less node). If it is not, find // the closest configured node. Check also if node is bound, i.e. it's allowed // to allocate memory from the node. If it's not allowed, map cpus in that node @@ -3176,7 +3176,7 @@ void os::Linux::rebuild_cpu_to_node_map() { // Check distance from all remaining nodes in the system. Ignore distance // from itself, from another non-configured node, and from another non-bound // node. - for (size_t m = 0; m < node_num; m++) { + for (int m = 0; m < node_num; m++) { if (m != i && is_node_in_configured_nodes(nindex_to_node()->at(m)) && is_node_in_bound_nodes(nindex_to_node()->at(m))) { @@ -3198,10 +3198,10 @@ void os::Linux::rebuild_cpu_to_node_map() { // Get cpus from the original node and map them to the closest node. If node // is a configured node (not a memory-less node), then original node and // closest node are the same. - if (numa_node_to_cpus(nindex_to_node()->at(i), cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) { - for (size_t j = 0; j < cpu_map_valid_size; j++) { + if (numa_node_to_cpus(nindex_to_node()->at(i), cpu_map, cpu_map_size * (int)sizeof(unsigned long)) != -1) { + for (int j = 0; j < cpu_map_valid_size; j++) { if (cpu_map[j] != 0) { - for (size_t k = 0; k < BitsPerCLong; k++) { + for (int k = 0; k < BitsPerCLong; k++) { if (cpu_map[j] & (1UL << k)) { int cpu_index = j * BitsPerCLong + k; @@ -3286,7 +3286,7 @@ static address get_stack_commited_bottom(address bottom, size_t size) { address ntop = bottom + size; size_t page_sz = os::vm_page_size(); - unsigned pages = size / page_sz; + unsigned pages = checked_cast(size / page_sz); unsigned char vec[1]; unsigned imin = 1, imax = pages + 1, imid; @@ -3336,21 +3336,21 @@ bool os::committed_in_range(address start, size_t size, address& committed_start vec[stripe] = 'X'; const size_t page_sz = os::vm_page_size(); - size_t pages = size / page_sz; + uintx pages = size / page_sz; assert(is_aligned(start, page_sz), "Start address must be page aligned"); assert(is_aligned(size, page_sz), "Size must be page aligned"); committed_start = nullptr; - int loops = (pages + stripe - 1) / stripe; + int loops = checked_cast((pages + stripe - 1) / stripe); int committed_pages = 0; address loop_base = start; bool found_range = false; for (int index = 0; index < loops && !found_range; index ++) { assert(pages > 0, "Nothing to do"); - int pages_to_query = (pages >= stripe) ? stripe : pages; + uintx pages_to_query = (pages >= stripe) ? stripe : pages; pages -= pages_to_query; // Get stable read @@ -3366,7 +3366,7 @@ bool os::committed_in_range(address start, size_t size, address& committed_start assert(vec[stripe] == 'X', "overflow guard"); assert(mincore_return_value == 0, "Range must be valid"); // Process this stripe - for (int vecIdx = 0; vecIdx < pages_to_query; vecIdx ++) { + for (uintx vecIdx = 0; vecIdx < pages_to_query; vecIdx ++) { if ((vec[vecIdx] & 0x01) == 0) { // not committed // End of current contiguous region if (committed_start != nullptr) { @@ -4395,13 +4395,13 @@ static void check_pax(void) { void os::init(void) { char dummy; // used to get a guess on initial stack address - clock_tics_per_sec = sysconf(_SC_CLK_TCK); - int sys_pg_size = sysconf(_SC_PAGESIZE); + clock_tics_per_sec = checked_cast(sysconf(_SC_CLK_TCK)); + int sys_pg_size = checked_cast(sysconf(_SC_PAGESIZE)); if (sys_pg_size < 0) { fatal("os_linux.cpp: os::init: sysconf failed (%s)", os::strerror(errno)); } - size_t page_size = (size_t) sys_pg_size; + size_t page_size = sys_pg_size; OSInfo::set_vm_page_size(page_size); OSInfo::set_vm_allocation_granularity(page_size); if (os::vm_page_size() == 0) { @@ -4745,7 +4745,7 @@ static int get_active_processor_count() { // Note: keep this function, with its CPU_xx macros, *outside* the os namespace (see JDK-8289477). cpu_set_t cpus; // can represent at most 1024 (CPU_SETSIZE) processors cpu_set_t* cpus_p = &cpus; - int cpus_size = sizeof(cpu_set_t); + size_t cpus_size = sizeof(cpu_set_t); int configured_cpus = os::processor_count(); // upper bound on available cpus int cpu_count = 0; @@ -4769,7 +4769,7 @@ static int get_active_processor_count() { } else { // failed to allocate so fallback to online cpus - int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN); + int online_cpus = checked_cast(::sysconf(_SC_NPROCESSORS_ONLN)); log_trace(os)("active_processor_count: " "CPU_ALLOC failed (%s) - using " "online processor count: %d", @@ -4801,7 +4801,7 @@ static int get_active_processor_count() { log_trace(os)("active_processor_count: sched_getaffinity processor count: %d", cpu_count); } else { - cpu_count = ::sysconf(_SC_NPROCESSORS_ONLN); + cpu_count = checked_cast(::sysconf(_SC_NPROCESSORS_ONLN)); warning("sched_getaffinity failed (%s)- using online processor count (%d) " "which may exceed available processors", os::strerror(errno), cpu_count); } @@ -5163,7 +5163,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { pid_t tid = thread->osthread()->thread_id(); char *s; char stat[2048]; - int statlen; + size_t statlen; char proc_name[64]; int count; long sys_time, user_time; @@ -5309,7 +5309,7 @@ int os::get_core_path(char* buffer, size_t bufferSize) { } } - return strlen(buffer); + return checked_cast(strlen(buffer)); } bool os::start_debugging(char *buf, int buflen) { @@ -5444,9 +5444,9 @@ static inline struct timespec get_mtime(const char* filename) { int os::compare_file_modified_times(const char* file1, const char* file2) { struct timespec filetime1 = get_mtime(file1); struct timespec filetime2 = get_mtime(file2); - int diff = filetime1.tv_sec - filetime2.tv_sec; + int diff = primitive_compare(filetime1.tv_sec, filetime2.tv_sec); if (diff == 0) { - return filetime1.tv_nsec - filetime2.tv_nsec; + diff = primitive_compare(filetime1.tv_nsec, filetime2.tv_nsec); } return diff; } diff --git a/src/hotspot/os/linux/os_perf_linux.cpp b/src/hotspot/os/linux/os_perf_linux.cpp index ff416d47eb0..cca41a12ee1 100644 --- a/src/hotspot/os/linux/os_perf_linux.cpp +++ b/src/hotspot/os/linux/os_perf_linux.cpp @@ -232,7 +232,7 @@ static double get_cpu_load(int which_logical_cpu, CPUPerfCounters* counters, dou */ static int SCANF_ARGS(2, 0) vread_statdata(const char* procfile, _SCANFMT_ const char* fmt, va_list args) { FILE*f; - int n; + ssize_t n; char buf[2048]; if ((f = os::fopen(procfile, "r")) == nullptr) { @@ -382,12 +382,12 @@ static double get_cpu_load(int which_logical_cpu, CPUPerfCounters* counters, dou } else if (tdiff < (udiff + kdiff)) { tdiff = udiff + kdiff; } - *pkernelLoad = (kdiff / (double)tdiff); + *pkernelLoad = ((double)kdiff / (double)tdiff); // BUG9044876, normalize return values to sane values *pkernelLoad = MAX2(*pkernelLoad, 0.0); *pkernelLoad = MIN2(*pkernelLoad, 1.0); - user_load = (udiff / (double)tdiff); + user_load = ((double)udiff / (double)tdiff); user_load = MAX2(user_load, 0.0); user_load = MIN2(user_load, 1.0); @@ -473,7 +473,7 @@ static int perf_context_switch_rate(double* rate) { if (d == 0) { *rate = lastRate; } else if (get_noof_context_switches(&sw) == 0) { - *rate = ( (double)(sw - lastSwitches) / d ) * 1000; + *rate = ( (double)(sw - lastSwitches) / (double)d ) * 1000; lastRate = *rate; lastSwitches = sw; if (bootTime != 0) { diff --git a/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp b/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp index afa17e0ade8..446449a40e0 100644 --- a/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp +++ b/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp @@ -56,12 +56,12 @@ enum membarrier_cmd { MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = (1 << 4), }; -static int membarrier(int cmd, unsigned int flags, int cpu_id) { +static long membarrier(int cmd, unsigned int flags, int cpu_id) { return syscall(SYS_membarrier, cmd, flags, cpu_id); // cpu_id only on >= 5.10 } bool LinuxSystemMemoryBarrier::initialize() { - int ret = membarrier(MEMBARRIER_CMD_QUERY, 0, 0); + long ret = membarrier(MEMBARRIER_CMD_QUERY, 0, 0); if (ret < 0) { log_info(os)("MEMBARRIER_CMD_QUERY unsupported"); return false; @@ -78,6 +78,6 @@ bool LinuxSystemMemoryBarrier::initialize() { } void LinuxSystemMemoryBarrier::emit() { - int s = membarrier(MEMBARRIER_CMD_PRIVATE_EXPEDITED, 0, 0); + long s = membarrier(MEMBARRIER_CMD_PRIVATE_EXPEDITED, 0, 0); guarantee_with_errno(s >= 0, "MEMBARRIER_CMD_PRIVATE_EXPEDITED failed"); } diff --git a/src/hotspot/os/linux/waitBarrier_linux.cpp b/src/hotspot/os/linux/waitBarrier_linux.cpp index de36dd60e49..2be31ce8366 100644 --- a/src/hotspot/os/linux/waitBarrier_linux.cpp +++ b/src/hotspot/os/linux/waitBarrier_linux.cpp @@ -37,7 +37,7 @@ #endif #endif -static int futex(volatile int *addr, int futex_op, int op_arg) { +static long futex(volatile int *addr, int futex_op, int op_arg) { return syscall(SYS_futex, addr, futex_op, op_arg, nullptr, nullptr, 0); } @@ -51,9 +51,9 @@ void LinuxWaitBarrier::arm(int barrier_tag) { void LinuxWaitBarrier::disarm() { assert(_futex_barrier != 0, "Should be armed/non-zero."); _futex_barrier = 0; - int s = futex(&_futex_barrier, - FUTEX_WAKE_PRIVATE, - INT_MAX /* wake a max of this many threads */); + long s = futex(&_futex_barrier, + FUTEX_WAKE_PRIVATE, + INT_MAX /* wake a max of this many threads */); guarantee_with_errno(s > -1, "futex FUTEX_WAKE failed"); } @@ -65,9 +65,9 @@ void LinuxWaitBarrier::wait(int barrier_tag) { return; } do { - int s = futex(&_futex_barrier, - FUTEX_WAIT_PRIVATE, - barrier_tag /* should be this tag */); + long s = futex(&_futex_barrier, + FUTEX_WAIT_PRIVATE, + barrier_tag /* should be this tag */); guarantee_with_errno((s == 0) || (s == -1 && errno == EAGAIN) || (s == -1 && errno == EINTR), diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 74929c982a6..44b23bfadf3 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -445,7 +445,7 @@ void os::Posix::print_load_average(outputStream* st) { // for reboot at least on my test machines void os::Posix::print_uptime_info(outputStream* st) { int bootsec = -1; - int currsec = time(nullptr); + time_t currsec = time(nullptr); struct utmpx* ent; setutxent(); while ((ent = getutxent())) { @@ -456,7 +456,7 @@ void os::Posix::print_uptime_info(outputStream* st) { } if (bootsec != -1) { - os::print_dhm(st, "OS uptime:", (long) (currsec-bootsec)); + os::print_dhm(st, "OS uptime:", currsec-bootsec); } } @@ -799,20 +799,20 @@ int os::socket_close(int fd) { return ::close(fd); } -int os::recv(int fd, char* buf, size_t nBytes, uint flags) { - RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, flags)); +ssize_t os::recv(int fd, char* buf, size_t nBytes, uint flags) { + RESTARTABLE_RETURN_SSIZE_T(::recv(fd, buf, nBytes, flags)); } -int os::send(int fd, char* buf, size_t nBytes, uint flags) { - RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags)); +ssize_t os::send(int fd, char* buf, size_t nBytes, uint flags) { + RESTARTABLE_RETURN_SSIZE_T(::send(fd, buf, nBytes, flags)); } -int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) { +ssize_t os::raw_send(int fd, char* buf, size_t nBytes, uint flags) { return os::send(fd, buf, nBytes, flags); } -int os::connect(int fd, struct sockaddr* him, socklen_t len) { - RESTARTABLE_RETURN_INT(::connect(fd, him, len)); +ssize_t os::connect(int fd, struct sockaddr* him, socklen_t len) { + RESTARTABLE_RETURN_SSIZE_T(::connect(fd, him, len)); } void os::exit(int num) { @@ -1208,7 +1208,7 @@ void os::Posix::init(void) { #if defined(_ALLBSD_SOURCE) clock_tics_per_sec = CLK_TCK; #else - clock_tics_per_sec = sysconf(_SC_CLK_TCK); + clock_tics_per_sec = checked_cast(sysconf(_SC_CLK_TCK)); #endif // NOTE: no logging available when this is called. Put logging // statements in init_2(). @@ -1332,7 +1332,7 @@ static jlong millis_to_nanos_bounded(jlong millis) { static void to_abstime(timespec* abstime, jlong timeout, bool isAbsolute, bool isRealtime) { - DEBUG_ONLY(int max_secs = MAX_SECS;) + DEBUG_ONLY(time_t max_secs = MAX_SECS;) if (timeout < 0) { timeout = 0; @@ -1414,7 +1414,7 @@ void os::javaTimeNanos_info(jvmtiTimerInfo *info_ptr) { // Time since start-up in seconds to a fine granularity. double os::elapsedTime() { - return ((double)os::elapsed_counter()) / os::elapsed_frequency(); // nanosecond resolution + return ((double)os::elapsed_counter()) / (double)os::elapsed_frequency(); // nanosecond resolution } jlong os::elapsed_counter() { diff --git a/src/hotspot/os/posix/os_posix.hpp b/src/hotspot/os/posix/os_posix.hpp index 051b23d51bd..8c71516f70b 100644 --- a/src/hotspot/os/posix/os_posix.hpp +++ b/src/hotspot/os/posix/os_posix.hpp @@ -44,8 +44,8 @@ _result = _cmd; \ } while(((int)_result == OS_ERR) && (errno == EINTR)) -#define RESTARTABLE_RETURN_INT(_cmd) do { \ - int _result; \ +#define RESTARTABLE_RETURN_SSIZE_T(_cmd) do { \ + ssize_t _result; \ RESTARTABLE(_cmd, _result); \ return _result; \ } while(false) diff --git a/src/hotspot/os/posix/signals_posix.cpp b/src/hotspot/os/posix/signals_posix.cpp index 285e69ba150..bbe4b7782bf 100644 --- a/src/hotspot/os/posix/signals_posix.cpp +++ b/src/hotspot/os/posix/signals_posix.cpp @@ -44,6 +44,7 @@ #include "suspendResume_posix.hpp" #include "utilities/events.hpp" #include "utilities/ostream.hpp" +#include "utilities/parseInteger.hpp" #include "utilities/vmError.hpp" #include @@ -681,7 +682,7 @@ static void UserHandler(int sig, siginfo_t* siginfo, void* context) { static void print_signal_handler_name(outputStream* os, address handler, char* buf, size_t buflen) { // We demangle, but omit arguments - signal handlers should have always the same prototype. - os::print_function_and_library_name(os, handler, buf, buflen, + os::print_function_and_library_name(os, handler, buf, checked_cast(buflen), true, // shorten_path true, // demangle true // omit arguments @@ -1726,8 +1727,9 @@ int SR_initialize() { char *s; // Get signal number to use for suspend/resume if ((s = ::getenv("_JAVA_SR_SIGNUM")) != 0) { - int sig = ::strtol(s, 0, 10); - if (sig > MAX2(SIGSEGV, SIGBUS) && // See 4355769. + int sig; + bool result = parse_integer(s, &sig); + if (result && sig > MAX2(SIGSEGV, SIGBUS) && // See 4355769. sig < NSIG) { // Must be legal signal and fit into sigflags[]. PosixSignals::SR_signum = sig; } else { diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 0a417bda1d3..2c072bf8e60 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -1762,7 +1762,7 @@ static inline time_t get_mtime(const char* filename) { int os::compare_file_modified_times(const char* file1, const char* file2) { time_t t1 = get_mtime(file1); time_t t2 = get_mtime(file2); - return t1 - t2; + return primitive_compare(t1, t2); } void os::print_os_info_brief(outputStream* st) { @@ -5608,19 +5608,19 @@ int os::socket_close(int fd) { return ::closesocket(fd); } -int os::connect(int fd, struct sockaddr* him, socklen_t len) { +ssize_t os::connect(int fd, struct sockaddr* him, socklen_t len) { return ::connect(fd, him, len); } -int os::recv(int fd, char* buf, size_t nBytes, uint flags) { +ssize_t os::recv(int fd, char* buf, size_t nBytes, uint flags) { return ::recv(fd, buf, (int)nBytes, flags); } -int os::send(int fd, char* buf, size_t nBytes, uint flags) { +ssize_t os::send(int fd, char* buf, size_t nBytes, uint flags) { return ::send(fd, buf, (int)nBytes, flags); } -int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) { +ssize_t os::raw_send(int fd, char* buf, size_t nBytes, uint flags) { return ::send(fd, buf, (int)nBytes, flags); } diff --git a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp index 930cf3f2657..727e0b3fcab 100644 --- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp +++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp @@ -463,7 +463,7 @@ juint os::cpu_microcode_revision() { fp = os::fopen("/proc/cpuinfo", "r"); if (fp) { char data[2048] = {0}; // lines should fit in 2K buf - size_t len = sizeof(data); + int len = (int)sizeof(data); while (!feof(fp)) { if (fgets(data, len, fp)) { if (strstr(data, "microcode") != nullptr) { diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp index 1d704e29ac7..156ed3c5e53 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -886,10 +886,10 @@ class os: AllStatic { // SocketInterface (ex HPI SocketInterface ) static int socket_close(int fd); - static int recv(int fd, char* buf, size_t nBytes, uint flags); - static int send(int fd, char* buf, size_t nBytes, uint flags); - static int raw_send(int fd, char* buf, size_t nBytes, uint flags); - static int connect(int fd, struct sockaddr* him, socklen_t len); + static ssize_t recv(int fd, char* buf, size_t nBytes, uint flags); + static ssize_t send(int fd, char* buf, size_t nBytes, uint flags); + static ssize_t raw_send(int fd, char* buf, size_t nBytes, uint flags); + static ssize_t connect(int fd, struct sockaddr* him, socklen_t len); // Support for signals static void initialize_jdk_signal_support(TRAPS); diff --git a/src/hotspot/share/utilities/ostream.cpp b/src/hotspot/share/utilities/ostream.cpp index 1dd413e63aa..4f641e54ecd 100644 --- a/src/hotspot/share/utilities/ostream.cpp +++ b/src/hotspot/share/utilities/ostream.cpp @@ -1096,15 +1096,15 @@ networkStream::networkStream() : bufferedStream(1024*10, 1024*10) { } } -int networkStream::read(char *buf, size_t len) { - return os::recv(_socket, buf, (int)len, 0); +ssize_t networkStream::read(char *buf, size_t len) { + return os::recv(_socket, buf, len, 0); } void networkStream::flush() { if (size() != 0) { - int result = os::raw_send(_socket, (char *)base(), size(), 0); + ssize_t result = os::raw_send(_socket, (char *)base(), size(), 0); assert(result != -1, "connection error"); - assert(result == (int)size(), "didn't send enough data"); + assert(result >= 0 && (size_t)result == size(), "didn't send enough data"); } reset(); } @@ -1143,9 +1143,9 @@ bool networkStream::connect(const char *host, short port) { return false; } - ret = os::connect(_socket, addr_info->ai_addr, (socklen_t)addr_info->ai_addrlen); + ssize_t conn = os::connect(_socket, addr_info->ai_addr, (socklen_t)addr_info->ai_addrlen); freeaddrinfo(addr_info); - return (ret >= 0); + return (conn >= 0); } #endif diff --git a/src/hotspot/share/utilities/ostream.hpp b/src/hotspot/share/utilities/ostream.hpp index 1b2a041a6ba..fd0bb3a3db5 100644 --- a/src/hotspot/share/utilities/ostream.hpp +++ b/src/hotspot/share/utilities/ostream.hpp @@ -321,7 +321,7 @@ class networkStream : public bufferedStream { bool connect(const char *host, short port); bool is_open() const { return _socket != -1; } - int read(char *buf, size_t len); + ssize_t read(char *buf, size_t len); void close(); virtual void flush(); }; From 004651ddc281be04ea736807797658d64a5a7337 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Tue, 15 Aug 2023 15:44:33 +0000 Subject: [PATCH 057/162] 8311557: [JVMCI] deadlock with JVMTI thread suspension Reviewed-by: thartmann, dnsimon --- src/hotspot/share/compiler/abstractCompiler.hpp | 1 + src/hotspot/share/compiler/compilerThread.cpp | 5 +++++ src/hotspot/share/compiler/compilerThread.hpp | 5 +++-- src/hotspot/share/jvmci/jvmciCompiler.hpp | 3 +++ src/hotspot/share/jvmci/jvmci_globals.cpp | 10 ++++++---- src/hotspot/share/jvmci/jvmci_globals.hpp | 5 +++++ 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/compiler/abstractCompiler.hpp b/src/hotspot/share/compiler/abstractCompiler.hpp index 724c0412db5..1b1421dcad2 100644 --- a/src/hotspot/share/compiler/abstractCompiler.hpp +++ b/src/hotspot/share/compiler/abstractCompiler.hpp @@ -150,6 +150,7 @@ class AbstractCompiler : public CHeapObj { bool is_c2() const { return _type == compiler_c2; } bool is_jvmci() const { return _type == compiler_jvmci; } CompilerType type() const { return _type; } + virtual bool is_hidden_from_external_view() const { return false; } // Customization virtual void initialize () = 0; diff --git a/src/hotspot/share/compiler/compilerThread.cpp b/src/hotspot/share/compiler/compilerThread.cpp index 8fadda27aa1..ddd49fec175 100644 --- a/src/hotspot/share/compiler/compilerThread.cpp +++ b/src/hotspot/share/compiler/compilerThread.cpp @@ -61,3 +61,8 @@ void CompilerThread::thread_entry(JavaThread* thread, TRAPS) { bool CompilerThread::can_call_java() const { return _compiler != nullptr && _compiler->is_jvmci(); } + +// Hide native compiler threads from external view. +bool CompilerThread::is_hidden_from_external_view() const { + return _compiler == nullptr || _compiler->is_hidden_from_external_view(); +} diff --git a/src/hotspot/share/compiler/compilerThread.hpp b/src/hotspot/share/compiler/compilerThread.hpp index 179ab7d25a2..3ae4bef3dad 100644 --- a/src/hotspot/share/compiler/compilerThread.hpp +++ b/src/hotspot/share/compiler/compilerThread.hpp @@ -72,8 +72,9 @@ class CompilerThread : public JavaThread { virtual bool can_call_java() const; - // Hide native compiler threads from external view. - bool is_hidden_from_external_view() const { return !can_call_java(); } + // Returns true if this CompilerThread is hidden from JVMTI and FlightRecorder. C1 and C2 are + // always hidden but JVMCI compiler threads might be hidden. + virtual bool is_hidden_from_external_view() const; void set_compiler(AbstractCompiler* c) { _compiler = c; } AbstractCompiler* compiler() const { return _compiler; } diff --git a/src/hotspot/share/jvmci/jvmciCompiler.hpp b/src/hotspot/share/jvmci/jvmciCompiler.hpp index c1229a0b141..bdb50cfc26a 100644 --- a/src/hotspot/share/jvmci/jvmciCompiler.hpp +++ b/src/hotspot/share/jvmci/jvmciCompiler.hpp @@ -103,6 +103,9 @@ class JVMCICompiler : public AbstractCompiler { bool is_c1 () { return false; } bool is_c2 () { return false; } + virtual bool is_hidden_from_external_view() const { return UseJVMCINativeLibrary && LibJVMCICompilerThreadHidden; } + + bool needs_stubs () { return false; } // Initialization diff --git a/src/hotspot/share/jvmci/jvmci_globals.cpp b/src/hotspot/share/jvmci/jvmci_globals.cpp index f1c60bf1a9c..01d550f786d 100644 --- a/src/hotspot/share/jvmci/jvmci_globals.cpp +++ b/src/hotspot/share/jvmci/jvmci_globals.cpp @@ -73,10 +73,11 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() { JVMCI_FLAG_CHECKED(EnableJVMCIProduct) JVMCI_FLAG_CHECKED(UseGraalJIT) - CHECK_NOT_SET(BootstrapJVMCI, UseJVMCICompiler) - CHECK_NOT_SET(PrintBootstrap, UseJVMCICompiler) - CHECK_NOT_SET(JVMCIThreads, UseJVMCICompiler) - CHECK_NOT_SET(JVMCIHostThreads, UseJVMCICompiler) + CHECK_NOT_SET(BootstrapJVMCI, UseJVMCICompiler) + CHECK_NOT_SET(PrintBootstrap, UseJVMCICompiler) + CHECK_NOT_SET(JVMCIThreads, UseJVMCICompiler) + CHECK_NOT_SET(JVMCIHostThreads, UseJVMCICompiler) + CHECK_NOT_SET(LibJVMCICompilerThreadHidden, UseJVMCICompiler) if (UseJVMCICompiler) { if (FLAG_IS_DEFAULT(UseJVMCINativeLibrary) && !UseJVMCINativeLibrary) { @@ -185,6 +186,7 @@ bool JVMCIGlobals::enable_jvmci_product_mode(JVMFlagOrigin origin, bool use_graa "UseJVMCINativeLibrary", "JVMCINativeLibraryThreadFraction", "JVMCINativeLibraryErrorFile", + "LibJVMCICompilerThreadHidden", nullptr }; diff --git a/src/hotspot/share/jvmci/jvmci_globals.hpp b/src/hotspot/share/jvmci/jvmci_globals.hpp index 7ab29bc7189..771a95c481d 100644 --- a/src/hotspot/share/jvmci/jvmci_globals.hpp +++ b/src/hotspot/share/jvmci/jvmci_globals.hpp @@ -157,6 +157,11 @@ class fileStream; "error data to this file" \ "[default: ./" LIBJVMCI_ERR_FILE "] (%p replaced with pid)") \ \ + product(bool, LibJVMCICompilerThreadHidden, true, EXPERIMENTAL, \ + "If true then native JVMCI compiler threads are hidden from " \ + "JVMTI and FlightRecorder. This must be set to false if you " \ + "wish to use a Java debugger against JVMCI threads.") \ + \ NOT_COMPILER2(product(bool, UseMultiplyToLenIntrinsic, false, DIAGNOSTIC, \ "Enables intrinsification of BigInteger.multiplyToLen()")) \ \ From 80809ef4ccdfd2ebfa9fd1eaf393d14e443dc760 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Tue, 15 Aug 2023 15:54:44 +0000 Subject: [PATCH 058/162] 8314248: Remove HotSpotConstantPool::isResolvedDynamicInvoke Reviewed-by: thartmann, dnsimon --- .../vm/ci/hotspot/HotSpotConstantPool.java | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java index bc81d77138a..2fb33ef7a28 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java @@ -949,26 +949,6 @@ static boolean isSignaturePolymorphicHolder(final ResolvedJavaType type) { return false; } - /** - * Check for a resolved dynamic adapter method at the specified index, resulting from either a - * resolved invokedynamic or invokevirtual on a signature polymorphic MethodHandle method - * (HotSpot invokehandle). - * - * @param cpi the constant pool index - * @param opcode the opcode of the instruction for which the lookup is being performed - * @return {@code true} if a signature polymorphic method reference was found, otherwise - * {@code false} - */ - public boolean isResolvedDynamicInvoke(int cpi, int opcode) { - if (Bytecodes.isInvokeHandleAlias(opcode)) { - final int methodRefCacheIndex = rawIndexToConstantPoolCacheIndex(cpi, opcode); - checkTag(compilerToVM().constantPoolRemapInstructionOperandFromCache(this, methodRefCacheIndex), constants.jvmMethodref); - int op = compilerToVM().isResolvedInvokeHandleInPool(this, methodRefCacheIndex); - return op == opcode; - } - return false; - } - public String getSourceFileName() { final int sourceFileNameIndex = UNSAFE.getChar(getConstantPoolPointer() + config().constantPoolSourceFileNameIndexOffset); if (sourceFileNameIndex == 0) { From 2e8a0ab27227b2e06e2ece3776f66ff0932ef353 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 15 Aug 2023 16:11:09 +0000 Subject: [PATCH 059/162] 8314120: Add tests for FileDescriptor.sync Reviewed-by: alanb, bpb --- test/jdk/java/io/FileDescriptor/Sync.java | 95 +++++++++++++++++++ .../bench/java/io/FileDescriptorSync.java | 70 ++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 test/jdk/java/io/FileDescriptor/Sync.java create mode 100644 test/micro/org/openjdk/bench/java/io/FileDescriptorSync.java diff --git a/test/jdk/java/io/FileDescriptor/Sync.java b/test/jdk/java/io/FileDescriptor/Sync.java new file mode 100644 index 00000000000..587d0bbe758 --- /dev/null +++ b/test/jdk/java/io/FileDescriptor/Sync.java @@ -0,0 +1,95 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8314120 + * @summary Sanity test for FileDescriptor.sync + * @library /test/lib + * @run main Sync + */ + +import java.io.File; +import java.io.FileDescriptor; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.SyncFailedException; +import jdk.test.lib.thread.VThreadRunner; + +public class Sync { + + static final String TEST_DIR = System.getProperty("test.dir", "."); + static final int TRIES = 10_000; + + public static void testWith(File file) throws Exception { + try (FileOutputStream fos = new FileOutputStream(file)) { + FileDescriptor fd = fos.getFD(); + for (int t = 0; t < TRIES; t++) { + fd.sync(); + } + } catch (SyncFailedException sfe) { + // Can happen on some filesystems, print it in the log + System.out.println("Sync failed (acceptable)"); + sfe.printStackTrace(); + } + } + + public static void main(String[] args) throws Exception { + // Run on platform threads + System.out.println("With platform threads"); + run(); + + // Run on virtual threads + System.out.println("With virtual threads"); + VThreadRunner.run(Sync::run); + + System.out.println("Complete"); + } + + private static class AutoDelete implements AutoCloseable { + private final File file; + + public AutoDelete(File file) { + this.file = file; + } + + public File file() { + return file; + } + + @Override + public void close() throws Exception { + file.delete(); + } + } + + public static void run() throws Exception { + try (var w = new AutoDelete(new File(TEST_DIR, "FileDescriptorSync1"))) { + testWith(w.file()); + } + + try (var w = new AutoDelete(File.createTempFile("FileDescriptorSync2", "tmp"))) { + testWith(w.file()); + } + } +} diff --git a/test/micro/org/openjdk/bench/java/io/FileDescriptorSync.java b/test/micro/org/openjdk/bench/java/io/FileDescriptorSync.java new file mode 100644 index 00000000000..ee6f5fce2f9 --- /dev/null +++ b/test/micro/org/openjdk/bench/java/io/FileDescriptorSync.java @@ -0,0 +1,70 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.bench.java.io; + +import org.openjdk.jmh.annotations.*; + +import java.io.File; +import java.io.FileDescriptor; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.SyncFailedException; +import java.util.concurrent.TimeUnit; + +/** + * Tests the cost of FileDescriptor.sync + */ +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(3) +public class FileDescriptorSync { + + private FileOutputStream fos; + private FileDescriptor fd; + + @Setup + public void setup() throws IOException { + File tmp = File.createTempFile("FileDescriptorSync", "bin"); + fos = new FileOutputStream(tmp); + fd = fos.getFD(); + } + + @TearDown + public void tearDown() throws IOException { + fos.close(); + } + + @Benchmark + public void sync() { + try { + fd.sync(); + } catch (SyncFailedException e) { + // The test assumes the temp filesystem accepts syncs. + // Avoid failing if it does not, measure the exceptional path then. + } + } + +} From f23995465767fa7319d2f6fac62b6ec74c0e4986 Mon Sep 17 00:00:00 2001 From: Gerard Ziemski Date: Tue, 15 Aug 2023 17:06:28 +0000 Subject: [PATCH 060/162] 8310134: NMT: thread count in Thread section of VM.native_memory output confusing with virtual threads Reviewed-by: jsjolen, dholmes, alanb --- src/hotspot/share/services/memReporter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/services/memReporter.cpp b/src/hotspot/share/services/memReporter.cpp index 4c2a5b898dc..1a50b9ed26c 100644 --- a/src/hotspot/share/services/memReporter.cpp +++ b/src/hotspot/share/services/memReporter.cpp @@ -226,7 +226,7 @@ void MemSummaryReporter::report_summary_of_type(MEMFLAGS flag, const VirtualMemory* thread_stack_usage = _vm_snapshot->by_type(mtThreadStack); // report thread count - out->print_cr("%27s (thread #" SIZE_FORMAT ")", " ", ThreadStackTracker::thread_count()); + out->print_cr("%27s (threads #" SIZE_FORMAT ")", " ", ThreadStackTracker::thread_count()); out->print("%27s (stack: ", " "); print_total(thread_stack_usage->reserved(), thread_stack_usage->committed()); } else { @@ -234,7 +234,7 @@ void MemSummaryReporter::report_summary_of_type(MEMFLAGS flag, const char* scale = current_scale(); // report thread count assert(ThreadStackTracker::thread_count() == 0, "Not used"); - out->print_cr("%27s (thread #" SIZE_FORMAT ")", " ", thread_stack_memory->malloc_count()); + out->print_cr("%27s (threads #" SIZE_FORMAT ")", " ", thread_stack_memory->malloc_count()); out->print("%27s (Stack: " SIZE_FORMAT "%s", " ", amount_in_current_scale(thread_stack_memory->malloc_size()), scale); } @@ -595,7 +595,7 @@ void MemSummaryDiffReporter::diff_summary_of_type(MEMFLAGS flag, } else if (flag == mtThread) { // report thread count - out->print("%27s (thread #" SIZE_FORMAT "", " ", _current_baseline.thread_count()); + out->print("%27s (threads #" SIZE_FORMAT "", " ", _current_baseline.thread_count()); const ssize_t thread_count_diff = counter_diff(_current_baseline.thread_count(), _early_baseline.thread_count()); if (thread_count_diff != 0) { out->print(" " SSIZE_PLUS_FORMAT, thread_count_diff); From f66c73d34b1e02681f46eb3cd78126c05014f845 Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Tue, 15 Aug 2023 19:52:56 +0000 Subject: [PATCH 061/162] 8314166: Update googletest to v1.14.0 Reviewed-by: kbarrett, stuefe, shade, erikj --- doc/building.html | 8 ++++---- doc/building.md | 6 +++--- make/autoconf/lib-tests.m4 | 2 +- make/conf/github-actions.conf | 2 +- make/conf/jib-profiles.js | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/building.html b/doc/building.html index c88d87f288b..04da0c13212 100644 --- a/doc/building.html +++ b/doc/building.html @@ -1115,13 +1115,13 @@

    Running Tests

    Test framework. The top directory, which contains both googletest and googlemock directories, should be specified via --with-gtest. The minimum supported -version of Google Test is 1.13.0, whose source code can be obtained:

    +version of Google Test is 1.14.0, whose source code can be obtained:

    • by downloading and unpacking the source bundle from here
    • -
    • or by checking out v1.13.0 tag of +href="https://github.com/google/googletest/releases/tag/v1.14.0">here
    • +
    • or by checking out v1.14.0 tag of googletest project: -git clone -b v1.13.0 https://github.com/google/googletest
    • +git clone -b v1.14.0 https://github.com/google/googletest

    To execute the most basic tests (tier 1), use:

    make run-test-tier1
    diff --git a/doc/building.md b/doc/building.md index e2504d12b4a..1274810c2d5 100644 --- a/doc/building.md +++ b/doc/building.md @@ -884,11 +884,11 @@ Download the latest `.tar.gz` file, unpack it, and point `--with-jtreg` to the Building of Hotspot Gtest suite requires the source code of Google Test framework. The top directory, which contains both `googletest` and `googlemock` directories, should be specified via `--with-gtest`. -The minimum supported version of Google Test is 1.13.0, whose source +The minimum supported version of Google Test is 1.14.0, whose source code can be obtained: - * by downloading and unpacking the source bundle from [here](https://github.com/google/googletest/releases/tag/v1.13.0) - * or by checking out `v1.13.0` tag of `googletest` project: `git clone -b v1.13.0 https://github.com/google/googletest` + * by downloading and unpacking the source bundle from [here](https://github.com/google/googletest/releases/tag/v1.14.0) + * or by checking out `v1.14.0` tag of `googletest` project: `git clone -b v1.14.0 https://github.com/google/googletest` To execute the most basic tests (tier 1), use: ``` diff --git a/make/autoconf/lib-tests.m4 b/make/autoconf/lib-tests.m4 index 3db1737eb13..e75103852c5 100644 --- a/make/autoconf/lib-tests.m4 +++ b/make/autoconf/lib-tests.m4 @@ -29,7 +29,7 @@ # Minimum supported versions JTREG_MINIMUM_VERSION=7.3 -GTEST_MINIMUM_VERSION=1.13.0 +GTEST_MINIMUM_VERSION=1.14.0 ############################################################################### # diff --git a/make/conf/github-actions.conf b/make/conf/github-actions.conf index 2dfc9b53489..60f1287eb4e 100644 --- a/make/conf/github-actions.conf +++ b/make/conf/github-actions.conf @@ -25,7 +25,7 @@ # Versions and download locations for dependencies used by GitHub Actions (GHA) -GTEST_VERSION=1.13.0 +GTEST_VERSION=1.14.0 JTREG_VERSION=7.3+1 LINUX_X64_BOOT_JDK_EXT=tar.gz diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 665c350a7a3..14d03f63a9a 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -1270,7 +1270,7 @@ var getJibProfilesDependencies = function (input, common) { gtest: { organization: common.organization, ext: "tar.gz", - revision: "1.13.0+1.0" + revision: "1.14.0+1.0" }, libffi: { From 0f5e030badfdca4b3b5adab86b0b62050581fb11 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Tue, 15 Aug 2023 20:55:27 +0000 Subject: [PATCH 062/162] 8309335: Get rid of use of reflection to call Thread.isVirtual() in nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java Reviewed-by: lmesnik, sspitsyn, alanb --- .../stepRequests/stepreq001t.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java index 1261e9f4aeb..cc64d696228 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,6 @@ package nsk.jdi.EventRequestManager.stepRequests; -import java.lang.reflect.Method; import nsk.share.jpda.*; import nsk.share.jdi.*; @@ -63,7 +62,7 @@ private int runThis(String args[]) { for (int i=1; i Date: Tue, 15 Aug 2023 22:34:37 +0000 Subject: [PATCH 063/162] 8311591: Add SystemModulesPlugin test case that splits module descriptors with new local variables defined by DedupSetBuilder Reviewed-by: mchung --- .../jlink/JLinkDedupTestBatchSizeOne.java | 115 ++++++++++++++++++ .../tools/jlink/dedup/src/m1/module-info.java | 36 ++++++ .../jlink/dedup/src/m1/p1/AInterface.java | 36 ++++++ .../tools/jlink/dedup/src/m2/module-info.java | 36 ++++++ .../jlink/dedup/src/m2/p2/BInterface.java | 35 ++++++ .../tools/jlink/dedup/src/m3/module-info.java | 26 ++++ .../dedup/src/m3/p3/ServiceInterface.java | 30 +++++ .../tools/jlink/dedup/src/m4/module-info.java | 30 +++++ .../jdk/tools/jlink/dedup/src/m4/p4/Main.java | 61 ++++++++++ 9 files changed, 405 insertions(+) create mode 100644 test/jdk/tools/jlink/JLinkDedupTestBatchSizeOne.java create mode 100644 test/jdk/tools/jlink/dedup/src/m1/module-info.java create mode 100644 test/jdk/tools/jlink/dedup/src/m1/p1/AInterface.java create mode 100644 test/jdk/tools/jlink/dedup/src/m2/module-info.java create mode 100644 test/jdk/tools/jlink/dedup/src/m2/p2/BInterface.java create mode 100644 test/jdk/tools/jlink/dedup/src/m3/module-info.java create mode 100644 test/jdk/tools/jlink/dedup/src/m3/p3/ServiceInterface.java create mode 100644 test/jdk/tools/jlink/dedup/src/m4/module-info.java create mode 100644 test/jdk/tools/jlink/dedup/src/m4/p4/Main.java diff --git a/test/jdk/tools/jlink/JLinkDedupTestBatchSizeOne.java b/test/jdk/tools/jlink/JLinkDedupTestBatchSizeOne.java new file mode 100644 index 00000000000..a8c8010ab3e --- /dev/null +++ b/test/jdk/tools/jlink/JLinkDedupTestBatchSizeOne.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.compiler.CompilerUtils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import tests.JImageGenerator; +import tests.Result; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +/* + * @test + * @summary Make sure that modules can be linked using jlink + * and deduplication works correctly when creating sub methods + * @bug 8311591 + * @library /test/lib + * ../lib + * @modules java.base/jdk.internal.jimage + * jdk.jdeps/com.sun.tools.classfile + * jdk.jlink/jdk.tools.jlink.internal + * jdk.jlink/jdk.tools.jlink.plugin + * jdk.jlink/jdk.tools.jmod + * jdk.jlink/jdk.tools.jimage + * jdk.compiler + * @build tests.* JLinkDedupTestBatchSizeOne jdk.test.lib.compiler.CompilerUtils + * @run main/othervm -Xmx1g -Xlog:init=debug -XX:+UnlockDiagnosticVMOptions -XX:+BytecodeVerificationLocal JLinkDedupTestBatchSizeOne + */ +public class JLinkDedupTestBatchSizeOne { + + private static final String JAVA_HOME = System.getProperty("java.home"); + private static final String TEST_SRC = System.getProperty("test.src"); + + private static final Path SRC_DIR = Paths.get(TEST_SRC, "dedup", "src"); + private static final Path MODS_DIR = Paths.get("mods"); + + private static final String MODULE_PATH = + Paths.get(JAVA_HOME, "jmods").toString() + + File.pathSeparator + MODS_DIR.toString(); + + // the names of the modules in this test + private static String[] modules = new String[]{"m1", "m2", "m3", "m4"}; + + private static boolean hasJmods() { + if (!Files.exists(Paths.get(JAVA_HOME, "jmods"))) { + System.err.println("Test skipped. No jmods directory"); + return false; + } + return true; + } + + public static void compileAll() throws Throwable { + if (!hasJmods()) return; + + for (String mn : modules) { + Path msrc = SRC_DIR.resolve(mn); + CompilerUtils.compile(msrc, MODS_DIR, + "--module-source-path", SRC_DIR.toString()); + } + } + + public static void main(String[] args) throws Throwable { + compileAll(); + Path image = Paths.get("bug8311591"); + + JImageGenerator.getJLinkTask() + .modulePath(MODULE_PATH) + .output(image.resolve("out-jlink-dedup")) + .addMods("m1") + .addMods("m2") + .addMods("m3") + .addMods("m4") + .option("--system-modules=batchSize=1") + .call() + .assertSuccess(); + + Path binDir = image.resolve("out-jlink-dedup").resolve("bin").toAbsolutePath(); + Path bin = binDir.resolve("java"); + + ProcessBuilder processBuilder = new ProcessBuilder(bin.toString(), + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+BytecodeVerificationLocal", + "-m", "m4/p4.Main"); + processBuilder.inheritIO(); + processBuilder.directory(binDir.toFile()); + Process process = processBuilder.start(); + int exitCode = process.waitFor(); + if (exitCode != 0) + throw new AssertionError("JLinkDedupTest100Modules failed to launch"); + } +} diff --git a/test/jdk/tools/jlink/dedup/src/m1/module-info.java b/test/jdk/tools/jlink/dedup/src/m1/module-info.java new file mode 100644 index 00000000000..a1645672d1e --- /dev/null +++ b/test/jdk/tools/jlink/dedup/src/m1/module-info.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import p1.AInterface; +import p3.ServiceInterface; + +module m1 { + exports p1 to m4; + + opens p1 to m4; + + requires transitive java.desktop; + requires m3; + + provides ServiceInterface with AInterface; +} diff --git a/test/jdk/tools/jlink/dedup/src/m1/p1/AInterface.java b/test/jdk/tools/jlink/dedup/src/m1/p1/AInterface.java new file mode 100644 index 00000000000..22dc66e2aea --- /dev/null +++ b/test/jdk/tools/jlink/dedup/src/m1/p1/AInterface.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package p1; +import p3.ServiceInterface; + +public class AInterface implements ServiceInterface { + + public String getString() { + return "A1_A2"; + } + + public String getServiceName() { + return "AService"; + } +} diff --git a/test/jdk/tools/jlink/dedup/src/m2/module-info.java b/test/jdk/tools/jlink/dedup/src/m2/module-info.java new file mode 100644 index 00000000000..7be9684f7a5 --- /dev/null +++ b/test/jdk/tools/jlink/dedup/src/m2/module-info.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import p2.BInterface; +import p3.ServiceInterface; + +module m2 { + exports p2 to m3,m4; + + opens p2 to m4; + + requires transitive java.desktop; + requires m3; + + provides ServiceInterface with BInterface; +} diff --git a/test/jdk/tools/jlink/dedup/src/m2/p2/BInterface.java b/test/jdk/tools/jlink/dedup/src/m2/p2/BInterface.java new file mode 100644 index 00000000000..904ff86e52f --- /dev/null +++ b/test/jdk/tools/jlink/dedup/src/m2/p2/BInterface.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package p2; +import p3.ServiceInterface; +public class BInterface implements ServiceInterface { + + public String getString() { + return "B1_B2"; + } + + public String getServiceName() { + return "BService"; + } +} diff --git a/test/jdk/tools/jlink/dedup/src/m3/module-info.java b/test/jdk/tools/jlink/dedup/src/m3/module-info.java new file mode 100644 index 00000000000..ff11f464e2e --- /dev/null +++ b/test/jdk/tools/jlink/dedup/src/m3/module-info.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +module m3 { + exports p3; +} diff --git a/test/jdk/tools/jlink/dedup/src/m3/p3/ServiceInterface.java b/test/jdk/tools/jlink/dedup/src/m3/p3/ServiceInterface.java new file mode 100644 index 00000000000..d3f339bc6d6 --- /dev/null +++ b/test/jdk/tools/jlink/dedup/src/m3/p3/ServiceInterface.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package p3; +public interface ServiceInterface { + + String getString(); + + String getServiceName(); +} diff --git a/test/jdk/tools/jlink/dedup/src/m4/module-info.java b/test/jdk/tools/jlink/dedup/src/m4/module-info.java new file mode 100644 index 00000000000..4d4c760f743 --- /dev/null +++ b/test/jdk/tools/jlink/dedup/src/m4/module-info.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import p3.ServiceInterface; + +module m4 { + requires m3; + requires transitive java.desktop; + uses ServiceInterface; +} diff --git a/test/jdk/tools/jlink/dedup/src/m4/p4/Main.java b/test/jdk/tools/jlink/dedup/src/m4/p4/Main.java new file mode 100644 index 00000000000..fa16fad5b45 --- /dev/null +++ b/test/jdk/tools/jlink/dedup/src/m4/p4/Main.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package p4; + +import p3.ServiceInterface; + +import java.lang.module.ModuleFinder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.ServiceLoader; + +public class Main { + + public static void main(String[] args) throws Exception { + List services = getServices(); + for (var service : services) { + System.out.println("Service name " + service.getServiceName()); + System.out.println("Service string " + service.getString()); + } + var moduleClass = Class.forName("jdk.internal.module.SystemModules$all"); + long subMethodCount = Arrays.stream(moduleClass.getDeclaredMethods()) + .filter(method -> method.getName().startsWith("sub")) + .count(); + + // one subX method per each module is generated as the image is linked with + // --system-modules=batchSize=1 + var moduleCount = (long) ModuleFinder.ofSystem().findAll().size(); + if (subMethodCount != moduleCount) { + throw new AssertionError("Difference in generated sub module methods count! Expected: " + + moduleCount + " but was " + subMethodCount); + } + } + + private static List getServices() { + List services = new ArrayList<>(); + ServiceLoader.load(ServiceInterface.class).forEach(services::add); + return services; + } +} From 6bf4a33593bfe0df9b5ba81de5321a04f4dbe0ea Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Wed, 16 Aug 2023 00:15:55 +0000 Subject: [PATCH 064/162] 8314242: Update applications/scimark/Scimark.java to accept VM flags Reviewed-by: dholmes --- test/hotspot/jtreg/applications/scimark/Scimark.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/applications/scimark/Scimark.java b/test/hotspot/jtreg/applications/scimark/Scimark.java index 96c5dccabef..8aab97aa2bc 100644 --- a/test/hotspot/jtreg/applications/scimark/Scimark.java +++ b/test/hotspot/jtreg/applications/scimark/Scimark.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,6 @@ /* * @test * @library /test/lib - * @requires vm.flagless * @run driver Scimark */ @@ -47,7 +46,9 @@ public static void main(String... args) throws Exception { + Scimark.class.getName(), e); } - OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + System.setProperty("test.noclasspath", "true"); + + OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createTestJvm( "-cp", artifacts.get("gov.nist.math.scimark-2.0").toString(), "jnt.scimark2.commandline", "-large") .start()); From 6a15860b126c9e9eb62579d9b710dcdc0ec489bb Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 16 Aug 2023 05:14:40 +0000 Subject: [PATCH 065/162] 8314163: os::print_hex_dump prints incorrectly for big endian platforms and unit sizes larger than 1 Reviewed-by: mbaesken, shade --- src/hotspot/share/runtime/os.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 965fd5603ba..9b2d59f9412 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -942,6 +942,7 @@ ATTRIBUTE_NO_ASAN static bool read_safely_from(intptr_t* p, intptr_t* result) { } static void print_hex_location(outputStream* st, address p, int unitsize) { + assert(is_aligned(p, unitsize), "Unaligned"); address pa = align_down(p, sizeof(intptr_t)); #ifndef _LP64 // Special handling for printing qwords on 32-bit platforms @@ -961,10 +962,14 @@ static void print_hex_location(outputStream* st, address p, int unitsize) { #endif // 32-bit, qwords intptr_t i = 0; if (read_safely_from((intptr_t*)pa, &i)) { + // bytes: CA FE BA BE DE AD C0 DE + // bytoff: 0 1 2 3 4 5 6 7 + // LE bits: 0 8 16 24 32 40 48 56 + // BE bits: 56 48 40 32 24 16 8 0 const int offset = (int)(p - (address)pa); const int bitoffset = LITTLE_ENDIAN_ONLY(offset * BitsPerByte) - BIG_ENDIAN_ONLY((int)(sizeof(intptr_t) - 1 - offset) * BitsPerByte); + BIG_ENDIAN_ONLY((int)((sizeof(intptr_t) - unitsize - offset) * BitsPerByte)); const int bitfieldsize = unitsize * BitsPerByte; intptr_t value = bitfield(i, bitoffset, bitfieldsize); switch (unitsize) { From 2bd2faeb7632703192ff8f58db5e58cfd0dfe120 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Wed, 16 Aug 2023 05:35:40 +0000 Subject: [PATCH 066/162] 4346610: Adding JSeparator to JToolBar "pushes" buttons added after separator to edge Reviewed-by: tr, aivanov, dnguyen --- .../swing/plaf/basic/BasicSeparatorUI.java | 18 +++- .../JToolBar/ToolBarSeparatorSizeTest.java | 98 +++++++++++++++++++ 2 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 test/jdk/javax/swing/JToolBar/ToolBarSeparatorSizeTest.java diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java index 0580765e1c0..eea9e9589a6 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSeparatorUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,12 +25,12 @@ package javax.swing.plaf.basic; -import javax.swing.*; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Insets; -import java.awt.Rectangle; +import javax.swing.JComponent; +import javax.swing.JSeparator; +import javax.swing.LookAndFeel; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.SeparatorUI; @@ -152,5 +152,13 @@ public Dimension getPreferredSize( JComponent c ) } public Dimension getMinimumSize( JComponent c ) { return null; } - public Dimension getMaximumSize( JComponent c ) { return null; } + + public Dimension getMaximumSize( JComponent c ) { + Dimension d = getPreferredSize(c); + if (((JSeparator)c).getOrientation() == JSeparator.VERTICAL) { + return new Dimension(d.width, Short.MAX_VALUE); + } else { + return new Dimension(Short.MAX_VALUE, d.height); + } + } } diff --git a/test/jdk/javax/swing/JToolBar/ToolBarSeparatorSizeTest.java b/test/jdk/javax/swing/JToolBar/ToolBarSeparatorSizeTest.java new file mode 100644 index 00000000000..47ad7e01b30 --- /dev/null +++ b/test/jdk/javax/swing/JToolBar/ToolBarSeparatorSizeTest.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4346610 + * @key headful + * @summary Verifies if Adding JSeparator to JToolBar "pushes" buttons added + * after separator to edge + * @run main ToolBarSeparatorSizeTest + */ +import java.awt.BorderLayout; +import java.awt.image.BufferedImage; +import java.awt.Rectangle; +import java.awt.Robot; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.JToolBar; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; + +import javax.imageio.ImageIO; + +public class ToolBarSeparatorSizeTest { + + private static JFrame frame; + private static JSeparator separator; + private static JToolBar toolBar; + private static volatile Rectangle toolBarBounds; + private static volatile int sepWidth; + private static volatile int sepPrefWidth; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + try { + SwingUtilities.invokeAndWait(() -> { + frame = new JFrame("ToolBar Separator Test"); + toolBar = new JToolBar(); + toolBar.add(new JButton("button 1")); + toolBar.add(new JButton("button 2")); + separator = new JSeparator(SwingConstants.VERTICAL); + toolBar.add(separator); + toolBar.add(new JButton("button 3")); + frame.getContentPane().setLayout(new BorderLayout()); + frame.getContentPane().add(toolBar, BorderLayout.NORTH); + frame.getContentPane().add(new JPanel(), BorderLayout.CENTER); + frame.setSize(400, 100); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + }); + robot.waitForIdle(); + robot.delay(1000); + SwingUtilities.invokeAndWait(() -> { + toolBarBounds = new Rectangle(toolBar.getLocationOnScreen(), + toolBar.getSize()); + sepWidth = separator.getSize().width; + sepPrefWidth = separator.getPreferredSize().width; + }); + if (sepWidth != sepPrefWidth) { + System.out.println("size " + sepWidth); + System.out.println("preferredSize " + sepPrefWidth); + BufferedImage img = robot.createScreenCapture(toolBarBounds); + ImageIO.write(img, "png", new java.io.File("image.png")); + throw new RuntimeException("Separator size is too wide"); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); + } + } +} From e1fdef56135c2987b128884ef632b64c32dd674a Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Wed, 16 Aug 2023 06:06:59 +0000 Subject: [PATCH 067/162] 8314324: "8311557: [JVMCI] deadlock with JVMTI thread suspension" causes various failures Reviewed-by: cjplummer, thartmann --- src/hotspot/share/compiler/abstractCompiler.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/compiler/abstractCompiler.hpp b/src/hotspot/share/compiler/abstractCompiler.hpp index 1b1421dcad2..d61ae639c3f 100644 --- a/src/hotspot/share/compiler/abstractCompiler.hpp +++ b/src/hotspot/share/compiler/abstractCompiler.hpp @@ -150,7 +150,9 @@ class AbstractCompiler : public CHeapObj { bool is_c2() const { return _type == compiler_c2; } bool is_jvmci() const { return _type == compiler_jvmci; } CompilerType type() const { return _type; } - virtual bool is_hidden_from_external_view() const { return false; } + + // Compiler threads are hidden by default. + virtual bool is_hidden_from_external_view() const { return true; } // Customization virtual void initialize () = 0; From 0b12480de88dc1d2a8d7ca3aa2597be3df1ebde1 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Wed, 16 Aug 2023 06:58:23 +0000 Subject: [PATCH 068/162] 8314233: C2: assert(assertion_predicate_has_loop_opaque_node(iff)) failed: unexpected Reviewed-by: thartmann, kvn --- src/hotspot/share/opto/loopTransform.cpp | 7 ++- .../TestPeelingFindsUnrelatedOpaque4Node.java | 62 +++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/compiler/predicates/TestPeelingFindsUnrelatedOpaque4Node.java diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index 29b878877e8..270cc16f8c7 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -2079,12 +2079,17 @@ void PhaseIdealLoop::initialize_assertion_predicates_for_peeled_loop(const Predi Node* control = outer_loop_head->in(LoopNode::EntryControl); Node* input_proj = control; + const Node* parse_predicate_uncommon_trap = predicate_block->parse_predicate()->uncommon_trap(); Node* next_regular_predicate_proj = predicate_block->skip_parse_predicate(); while (next_regular_predicate_proj->is_IfProj()) { IfNode* iff = next_regular_predicate_proj->in(0)->as_If(); + ProjNode* uncommon_proj = iff->proj_out(1 - next_regular_predicate_proj->as_Proj()->_con); + if (uncommon_proj->unique_ctrl_out() != parse_predicate_uncommon_trap) { + // Does not belong to this Predicate Block anymore. + break; + } if (iff->in(1)->Opcode() == Op_Opaque4) { assert(assertion_predicate_has_loop_opaque_node(iff), "unexpected"); - ProjNode* uncommon_proj = iff->proj_out(1 - next_regular_predicate_proj->as_Proj()->_con); input_proj = clone_assertion_predicate_and_initialize(iff, init, stride, next_regular_predicate_proj, uncommon_proj, control, outer_loop, input_proj); diff --git a/test/hotspot/jtreg/compiler/predicates/TestPeelingFindsUnrelatedOpaque4Node.java b/test/hotspot/jtreg/compiler/predicates/TestPeelingFindsUnrelatedOpaque4Node.java new file mode 100644 index 00000000000..7944271bd8f --- /dev/null +++ b/test/hotspot/jtreg/compiler/predicates/TestPeelingFindsUnrelatedOpaque4Node.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8314233 + * @requires vm.compiler2.enabled + * @summary Test that loop peeling does not treat unrelated Opaque4 node as Template Assertion Predicate. + * @run main/othervm -Xbatch -XX:LoopMaxUnroll=0 + * -XX:CompileCommand=compileonly,compiler.predicates.TestPeelingFindsUnrelatedOpaque4Node::* + * -XX:CompileCommand=inline,*String::* compiler.predicates.TestPeelingFindsUnrelatedOpaque4Node + */ + +package compiler.predicates; + +public class TestPeelingFindsUnrelatedOpaque4Node { + static int iFld; + static boolean flag; + + public static void main(String[] args) { + for (int i = 0; i < 1000; i++) { + test(); + flag = !flag; + } + } + + static void test() { + String s = flag ? "34323653" : "343423"; + s.contains("343"); + // Inlined and will call StringLatin1.indexOf intrinsics which emits Opaque4 node which will be wrongly + // found as Template Assertion Predicate when trying to initialize them which triggers the assert. + s.contains("3442"); + + for (int i = 0; i < 100; i++) { + if (flag) { // Triggers peeling + return; + } + iFld = 34; + } + } +} From a602624ef46908456052146d50467c60efa636c3 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 16 Aug 2023 07:02:48 +0000 Subject: [PATCH 069/162] 8314020: Print instruction blocks in byte units Reviewed-by: stuefe, fyang --- src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp | 2 +- src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp | 2 +- src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp | 2 +- src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp | 2 +- src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp | 2 +- src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp | 2 +- src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp | 2 +- src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp | 2 +- src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp | 2 +- src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp | 2 +- src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp | 2 +- src/hotspot/share/runtime/os.hpp | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp index 3882ed67703..2ade1c7153b 100644 --- a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp +++ b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp @@ -463,7 +463,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::Posix::ucontext_get_pc(uc); - print_instructions(st, pc, /*instrsize=*/4); + print_instructions(st, pc); st->cr(); // Try to decode the instructions. diff --git a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp index ae5d249a5db..e2696a52475 100644 --- a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp +++ b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp @@ -477,7 +477,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::Posix::ucontext_get_pc(uc); - print_instructions(st, pc, 4/*native instruction size*/); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp b/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp index 961464fa38d..0fb1b958339 100644 --- a/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp +++ b/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp @@ -854,7 +854,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::Posix::ucontext_get_pc(uc); - print_instructions(st, pc, sizeof(char)); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp index 28e17385d43..70581166cf1 100644 --- a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp +++ b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp @@ -355,7 +355,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::fetch_frame_from_context(uc).pc(); - print_instructions(st, pc, 4/*native instruction size*/); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp b/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp index 3bbe93fe798..86e8ed25618 100644 --- a/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp +++ b/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp @@ -483,7 +483,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::Posix::ucontext_get_pc(uc); - print_instructions(st, pc, Assembler::InstructionSize); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp index e5837af0a73..2e603ac0690 100644 --- a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp +++ b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp @@ -477,7 +477,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::Posix::ucontext_get_pc(uc); - print_instructions(st, pc, /*instrsize=*/4); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp b/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp index 814ae19d639..6eeb76acbbf 100644 --- a/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp +++ b/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp @@ -367,7 +367,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::fetch_frame_from_context(uc).pc(); - print_instructions(st, pc, UseRVC ? sizeof(char) : (int)NativeInstruction::instruction_size); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp b/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp index 206573b078a..033ea14ead6 100644 --- a/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp +++ b/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp @@ -456,7 +456,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::Posix::ucontext_get_pc(uc); - print_instructions(st, pc, /*intrsize=*/4); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp index 727e0b3fcab..db5e1ed4bf2 100644 --- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp +++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp @@ -571,7 +571,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::fetch_frame_from_context(uc).pc(); - print_instructions(st, pc, sizeof(char)); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp b/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp index 101dbdcb4d1..07f8eaa6030 100644 --- a/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp +++ b/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp @@ -409,7 +409,7 @@ void os::print_tos_pc(outputStream *st, const void* ucVoid) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::Posix::ucontext_get_pc(uc); - print_instructions(st, pc, sizeof(char)); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp b/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp index d92e089f02b..4e18334315a 100644 --- a/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp +++ b/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp @@ -469,7 +469,7 @@ void os::print_tos_pc(outputStream *st, const void *context) { // point to garbage if entry point in an nmethod is corrupted. Leave // this at the end, and hope for the best. address pc = os::fetch_frame_from_context(uc).pc(); - print_instructions(st, pc, sizeof(char)); + print_instructions(st, pc); st->cr(); } diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp index 156ed3c5e53..56173431ab2 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -772,7 +772,7 @@ class os: AllStatic { static void print_context(outputStream* st, const void* context); static void print_tos_pc(outputStream* st, const void* context); static void print_tos(outputStream* st, address sp); - static void print_instructions(outputStream* st, address pc, int unitsize); + static void print_instructions(outputStream* st, address pc, int unitsize = 1); static void print_register_info(outputStream* st, const void* context, int& continuation); static void print_register_info(outputStream* st, const void* context); static bool signal_sent_by_kill(const void* siginfo); From 38687f1a3eb7d1c2e8aa43b85509ab7999fe0e40 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 16 Aug 2023 07:04:25 +0000 Subject: [PATCH 070/162] 8314262: GHA: Cut down cross-compilation sysroots deeper Reviewed-by: erikj --- .github/workflows/build-cross-compile.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index a00e7746686..441b4b43192 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -153,7 +153,8 @@ jobs: sudo chown ${USER} -R sysroot rm -rf sysroot/{dev,proc,run,sys,var} rm -rf sysroot/usr/{sbin,bin,share} - rm -rf sysroot/usr/lib/{apt,udev,systemd} + rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd} + rm -rf sysroot/usr/libexec/gcc if: steps.get-cached-sysroot.outputs.cache-hit != 'true' - name: 'Configure' From d46f0fb31888db75f5b2b78a162fec16dfc5d0d9 Mon Sep 17 00:00:00 2001 From: Emanuel Peter Date: Wed, 16 Aug 2023 07:15:43 +0000 Subject: [PATCH 071/162] 8313720: C2 SuperWord: wrong result with -XX:+UseVectorCmov -XX:+UseCMoveUnconditionally Reviewed-by: chagedorn, thartmann --- src/hotspot/share/opto/superword.cpp | 9 + .../c2/irTests/TestVectorConditionalMove.java | 175 +++++++++++++++++- 2 files changed, 174 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/opto/superword.cpp b/src/hotspot/share/opto/superword.cpp index 3e78b5580c5..8cd3e46dcf5 100644 --- a/src/hotspot/share/opto/superword.cpp +++ b/src/hotspot/share/opto/superword.cpp @@ -1270,6 +1270,7 @@ bool SuperWord::isomorphic(Node* s1, Node* s2) { if (s1->Opcode() != s2->Opcode()) return false; if (s1->req() != s2->req()) return false; if (!same_velt_type(s1, s2)) return false; + if (s1->is_Bool() && s1->as_Bool()->_test._test != s2->as_Bool()->_test._test) return false; Node* s1_ctrl = s1->in(0); Node* s2_ctrl = s2->in(0); // If the control nodes are equivalent, no further checks are required to test for isomorphism. @@ -2656,6 +2657,14 @@ bool SuperWord::output() { Node_List* p_bol = my_pack(bol); assert(p_bol != nullptr, "CMove must have matching Bool pack"); +#ifdef ASSERT + for (uint j = 0; j < p_bol->size(); j++) { + Node* m = p_bol->at(j); + assert(m->as_Bool()->_test._test == bol_test, + "all bool nodes must have same test"); + } +#endif + CmpNode* cmp = bol->in(1)->as_Cmp(); assert(cmp != nullptr, "must have cmp above CMove"); Node_List* p_cmp = my_pack(cmp); diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java index f50b091719e..6f6b7f5bd30 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorConditionalMove.java @@ -31,7 +31,7 @@ /* * @test - * @bug 8289422 8306088 + * @bug 8289422 8306088 8313720 * @key randomness * @summary Auto-vectorization enhancement to support vector conditional move. * @library /test/lib / @@ -395,6 +395,58 @@ private static void testCMoveFNEQforFConst(float[] a, float[] b, float[] c) { } } + @Test + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveFLTforFConstH2(float[] a, float[] b, float[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] < b[i+0]) ? 0.1f : -0.1f; + c[i+1] = (a[i+1] < b[i+1]) ? 0.1f : -0.1f; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_F, ">0", + IRNode.VECTOR_MASK_CMP_F, ">0", + IRNode.VECTOR_BLEND_F, ">0", + IRNode.STORE_VECTOR, ">0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveFLEforFConstH2(float[] a, float[] b, float[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] <= b[i+0]) ? 0.1f : -0.1f; + c[i+1] = (a[i+1] <= b[i+1]) ? 0.1f : -0.1f; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_F, "=0", + IRNode.VECTOR_MASK_CMP_F, "=0", + IRNode.VECTOR_BLEND_F, "=0", + IRNode.STORE_VECTOR, "=0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveFYYforFConstH2(float[] a, float[] b, float[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] <= b[i+0]) ? 0.1f : -0.1f; + c[i+1] = (a[i+1] < b[i+1]) ? 0.1f : -0.1f; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_F, "=0", + IRNode.VECTOR_MASK_CMP_F, "=0", + IRNode.VECTOR_BLEND_F, "=0", + IRNode.STORE_VECTOR, "=0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveFXXforFConstH2(float[] a, float[] b, float[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] < b[i+0]) ? 0.1f : -0.1f; + c[i+1] = (a[i+1] <= b[i+1]) ? 0.1f : -0.1f; + } + } + @Test @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", IRNode.VECTOR_MASK_CMP_D, ">0", @@ -467,6 +519,58 @@ private static void testCMoveDNEQforDConst(double[] a, double[] b, double[] c) { } } + @Test + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveDLTforDConstH2(double[] a, double[] b, double[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] < b[i+0]) ? 0.1 : -0.1; + c[i+1] = (a[i+1] < b[i+1]) ? 0.1 : -0.1; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_D, ">0", + IRNode.VECTOR_MASK_CMP_D, ">0", + IRNode.VECTOR_BLEND_D, ">0", + IRNode.STORE_VECTOR, ">0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveDLEforDConstH2(double[] a, double[] b, double[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] <= b[i+0]) ? 0.1 : -0.1; + c[i+1] = (a[i+1] <= b[i+1]) ? 0.1 : -0.1; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_D, "=0", + IRNode.VECTOR_MASK_CMP_D, "=0", + IRNode.VECTOR_BLEND_D, "=0", + IRNode.STORE_VECTOR, "=0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveDYYforDConstH2(double[] a, double[] b, double[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] <= b[i+0]) ? 0.1 : -0.1; + c[i+1] = (a[i+1] < b[i+1]) ? 0.1 : -0.1; + } + } + + @Test + @IR(counts = {IRNode.LOAD_VECTOR_D, "=0", + IRNode.VECTOR_MASK_CMP_D, "=0", + IRNode.VECTOR_BLEND_D, "=0", + IRNode.STORE_VECTOR, "=0"}, + applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"}) + private static void testCMoveDXXforDConstH2(double[] a, double[] b, double[] c) { + for (int i = 0; i < a.length; i+=2) { + c[i+0] = (a[i+0] < b[i+0]) ? 0.1 : -0.1; + c[i+1] = (a[i+1] <= b[i+1]) ? 0.1 : -0.1; + } + } + // Extension: Compare 2 ILFD values, and pick from 2 ILFD values // Note: // To guarantee that CMove is introduced, I need to perform the loads before the branch. To ensure they @@ -716,7 +820,11 @@ private static void testCMoveVDUnsupported() { "testCMoveFGTforFConst", "testCMoveFGEforFConst", "testCMoveFLTforFConst", "testCMoveFLEforFConst", "testCMoveFEQforFConst", "testCMoveFNEQforFConst", "testCMoveDGTforDConst", "testCMoveDGEforDConst", "testCMoveDLTforDConst", - "testCMoveDLEforDConst", "testCMoveDEQforDConst", "testCMoveDNEQforDConst"}) + "testCMoveDLEforDConst", "testCMoveDEQforDConst", "testCMoveDNEQforDConst", + "testCMoveFLTforFConstH2", "testCMoveFLEforFConstH2", + "testCMoveFYYforFConstH2", "testCMoveFXXforFConstH2", + "testCMoveDLTforDConstH2", "testCMoveDLEforDConstH2", + "testCMoveDYYforDConstH2", "testCMoveDXXforDConstH2"}) private void testCMove_runner() { float[] floata = new float[SIZE]; float[] floatb = new float[SIZE]; @@ -815,6 +923,39 @@ private void testCMove_runner() { Asserts.assertEquals(floatc[i], cmoveFNEQforFConst(floata[i], floatb[i])); Asserts.assertEquals(doublec[i], cmoveDNEQforDConst(doublea[i], doubleb[i])); } + + // Hand-unrolled (H2) examples: + testCMoveFLTforFConstH2(floata, floatb, floatc); + testCMoveDLTforDConstH2(doublea, doubleb, doublec); + for (int i = 0; i < SIZE; i++) { + Asserts.assertEquals(floatc[i], cmoveFLTforFConst(floata[i], floatb[i])); + Asserts.assertEquals(doublec[i], cmoveDLTforDConst(doublea[i], doubleb[i])); + } + + testCMoveFLEforFConstH2(floata, floatb, floatc); + testCMoveDLEforDConstH2(doublea, doubleb, doublec); + for (int i = 0; i < SIZE; i++) { + Asserts.assertEquals(floatc[i], cmoveFLEforFConst(floata[i], floatb[i])); + Asserts.assertEquals(doublec[i], cmoveDLEforDConst(doublea[i], doubleb[i])); + } + + testCMoveFYYforFConstH2(floata, floatb, floatc); + testCMoveDYYforDConstH2(doublea, doubleb, doublec); + for (int i = 0; i < SIZE; i+=2) { + Asserts.assertEquals(floatc[i+0], cmoveFLEforFConst(floata[i+0], floatb[i+0])); + Asserts.assertEquals(doublec[i+0], cmoveDLEforDConst(doublea[i+0], doubleb[i+0])); + Asserts.assertEquals(floatc[i+1], cmoveFLTforFConst(floata[i+1], floatb[i+1])); + Asserts.assertEquals(doublec[i+1], cmoveDLTforDConst(doublea[i+1], doubleb[i+1])); + } + + testCMoveFXXforFConstH2(floata, floatb, floatc); + testCMoveDXXforDConstH2(doublea, doubleb, doublec); + for (int i = 0; i < SIZE; i+=2) { + Asserts.assertEquals(floatc[i+0], cmoveFLTforFConst(floata[i+0], floatb[i+0])); + Asserts.assertEquals(doublec[i+0], cmoveDLTforDConst(doublea[i+0], doubleb[i+0])); + Asserts.assertEquals(floatc[i+1], cmoveFLEforFConst(floata[i+1], floatb[i+1])); + Asserts.assertEquals(doublec[i+1], cmoveDLEforDConst(doublea[i+1], doubleb[i+1])); + } } @Warmup(0) @@ -981,19 +1122,33 @@ private static void init(long[] a) { private static void init(float[] a) { for (int i = 0; i < SIZE; i++) { - a[i] = RANDOM.nextFloat(); - if (RANDOM.nextInt() % 20 == 0) { - a[i] = Float.NaN; - } + a[i] = switch(RANDOM.nextInt() % 20) { + case 0 -> Float.NaN; + case 1 -> 0; + case 2 -> 1; + case 3 -> Float.POSITIVE_INFINITY; + case 4 -> Float.NEGATIVE_INFINITY; + case 5 -> Float.MAX_VALUE; + case 6 -> Float.MIN_VALUE; + case 7, 8, 9 -> RANDOM.nextFloat(); + default -> Float.intBitsToFloat(RANDOM.nextInt()); + }; } } private static void init(double[] a) { for (int i = 0; i < SIZE; i++) { - a[i] = RANDOM.nextDouble(); - if (RANDOM.nextInt() % 20 == 0) { - a[i] = Double.NaN; - } + a[i] = switch(RANDOM.nextInt() % 20) { + case 0 -> Double.NaN; + case 1 -> 0; + case 2 -> 1; + case 3 -> Double.POSITIVE_INFINITY; + case 4 -> Double.NEGATIVE_INFINITY; + case 5 -> Double.MAX_VALUE; + case 6 -> Double.MIN_VALUE; + case 7, 8, 9 -> RANDOM.nextDouble(); + default -> Double.longBitsToDouble(RANDOM.nextLong()); + }; } } } From 49ddb1997256d9fb7149d274d8afa18f7c2609a4 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Wed, 16 Aug 2023 07:21:04 +0000 Subject: [PATCH 072/162] 8313760: [REDO] Enhance AES performance Co-authored-by: Andrew Haley Reviewed-by: adinn, aph, sviswanathan, rhalade, kvn, dlong --- .../cpu/aarch64/stubGenerator_aarch64.cpp | 48 +++++++++---- src/hotspot/cpu/x86/assembler_x86.cpp | 8 +++ src/hotspot/cpu/x86/assembler_x86.hpp | 2 + src/hotspot/cpu/x86/macroAssembler_x86.cpp | 11 +++ src/hotspot/cpu/x86/macroAssembler_x86.hpp | 3 + src/hotspot/cpu/x86/stubGenerator_x86_64.hpp | 3 +- .../cpu/x86/stubGenerator_x86_64_aes.cpp | 68 +++++++++++++------ 7 files changed, 106 insertions(+), 37 deletions(-) diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index 3fc9c4fdef8..c08b3c420d7 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -2944,6 +2944,23 @@ class StubGenerator: public StubCodeGenerator { return start; } + // Big-endian 128-bit + 64-bit -> 128-bit addition. + // Inputs: 128-bits. in is preserved. + // The least-significant 64-bit word is in the upper dword of each vector. + // inc (the 64-bit increment) is preserved. Its lower dword must be zero. + // Output: result + void be_add_128_64(FloatRegister result, FloatRegister in, + FloatRegister inc, FloatRegister tmp) { + assert_different_registers(result, tmp, inc); + + __ addv(result, __ T2D, in, inc); // Add inc to the least-significant dword of + // input + __ cm(__ HI, tmp, __ T2D, inc, result);// Check for result overflowing + __ ext(tmp, __ T16B, tmp, tmp, 0x08); // Swap LSD of comparison result to MSD and + // MSD == 0 (must be!) to LSD + __ subv(result, __ T2D, result, tmp); // Subtract -1 from MSD if there was an overflow + } + // CTR AES crypt. // Arguments: // @@ -3053,13 +3070,16 @@ class StubGenerator: public StubCodeGenerator { // Setup the counter __ movi(v4, __ T4S, 0); __ movi(v5, __ T4S, 1); - __ ins(v4, __ S, v5, 3, 3); // v4 contains { 0, 0, 0, 1 } + __ ins(v4, __ S, v5, 2, 2); // v4 contains { 0, 1 } - __ ld1(v0, __ T16B, counter); // Load the counter into v0 - __ rev32(v16, __ T16B, v0); - __ addv(v16, __ T4S, v16, v4); - __ rev32(v16, __ T16B, v16); - __ st1(v16, __ T16B, counter); // Save the incremented counter back + // 128-bit big-endian increment + __ ld1(v0, __ T16B, counter); + __ rev64(v16, __ T16B, v0); + be_add_128_64(v16, v16, v4, /*tmp*/v5); + __ rev64(v16, __ T16B, v16); + __ st1(v16, __ T16B, counter); + // Previous counter value is in v0 + // v4 contains { 0, 1 } { // We have fewer than bulk_width blocks of data left. Encrypt @@ -3091,9 +3111,9 @@ class StubGenerator: public StubCodeGenerator { // Increment the counter, store it back __ orr(v0, __ T16B, v16, v16); - __ rev32(v16, __ T16B, v16); - __ addv(v16, __ T4S, v16, v4); - __ rev32(v16, __ T16B, v16); + __ rev64(v16, __ T16B, v16); + be_add_128_64(v16, v16, v4, /*tmp*/v5); + __ rev64(v16, __ T16B, v16); __ st1(v16, __ T16B, counter); // Save the incremented counter back __ b(inner_loop); @@ -3141,7 +3161,7 @@ class StubGenerator: public StubCodeGenerator { // Keys should already be loaded into the correct registers __ ld1(v0, __ T16B, counter); // v0 contains the first counter - __ rev32(v16, __ T16B, v0); // v16 contains byte-reversed counter + __ rev64(v16, __ T16B, v0); // v16 contains byte-reversed counter // AES/CTR loop { @@ -3151,12 +3171,12 @@ class StubGenerator: public StubCodeGenerator { // Setup the counters __ movi(v8, __ T4S, 0); __ movi(v9, __ T4S, 1); - __ ins(v8, __ S, v9, 3, 3); // v8 contains { 0, 0, 0, 1 } + __ ins(v8, __ S, v9, 2, 2); // v8 contains { 0, 1 } for (int i = 0; i < bulk_width; i++) { FloatRegister v0_ofs = as_FloatRegister(v0->encoding() + i); - __ rev32(v0_ofs, __ T16B, v16); - __ addv(v16, __ T4S, v16, v8); + __ rev64(v0_ofs, __ T16B, v16); + be_add_128_64(v16, v16, v8, /*tmp*/v9); } __ ld1(v8, v9, v10, v11, __ T16B, __ post(in, 4 * 16)); @@ -3186,7 +3206,7 @@ class StubGenerator: public StubCodeGenerator { } // Save the counter back where it goes - __ rev32(v16, __ T16B, v16); + __ rev64(v16, __ T16B, v16); __ st1(v16, __ T16B, counter); __ pop(saved_regs, sp); diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index a33d505814d..5d6335691bc 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -4431,6 +4431,14 @@ void Assembler::evpcmpuw(KRegister kdst, XMMRegister nds, XMMRegister src, Compa emit_int24(0x3E, (0xC0 | encode), vcc); } +void Assembler::evpcmpuq(KRegister kdst, XMMRegister nds, XMMRegister src, ComparisonPredicate vcc, int vector_len) { + assert(VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int24(0x1E, (0xC0 | encode), vcc); +} + void Assembler::evpcmpuw(KRegister kdst, XMMRegister nds, Address src, ComparisonPredicate vcc, int vector_len) { assert(VM_Version::supports_avx512vlbw(), ""); InstructionMark im(this); diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index 25101c0f052..b86bea3805e 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -1806,6 +1806,8 @@ class Assembler : public AbstractAssembler { void evpcmpuw(KRegister kdst, XMMRegister nds, XMMRegister src, ComparisonPredicate vcc, int vector_len); void evpcmpuw(KRegister kdst, XMMRegister nds, Address src, ComparisonPredicate vcc, int vector_len); + void evpcmpuq(KRegister kdst, XMMRegister nds, XMMRegister src, ComparisonPredicate vcc, int vector_len); + void pcmpeqw(XMMRegister dst, XMMRegister src); void vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void evpcmpeqw(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len); diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 87e6640c1b3..709818f391e 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -9257,6 +9257,17 @@ void MacroAssembler::evpandq(XMMRegister dst, XMMRegister nds, AddressLiteral sr } } +void MacroAssembler::evpaddq(XMMRegister dst, KRegister mask, XMMRegister nds, AddressLiteral src, bool merge, int vector_len, Register rscratch) { + assert(rscratch != noreg || always_reachable(src), "missing"); + + if (reachable(src)) { + Assembler::evpaddq(dst, mask, nds, as_Address(src), merge, vector_len); + } else { + lea(rscratch, src); + Assembler::evpaddq(dst, mask, nds, Address(rscratch, 0), merge, vector_len); + } +} + void MacroAssembler::evporq(XMMRegister dst, XMMRegister nds, AddressLiteral src, int vector_len, Register rscratch) { assert(rscratch != noreg || always_reachable(src), "missing"); diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index 2ef6677281c..5c7175e8ab6 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -1788,6 +1788,9 @@ class MacroAssembler: public Assembler { using Assembler::evpandq; void evpandq(XMMRegister dst, XMMRegister nds, AddressLiteral src, int vector_len, Register rscratch = noreg); + using Assembler::evpaddq; + void evpaddq(XMMRegister dst, KRegister mask, XMMRegister nds, AddressLiteral src, bool merge, int vector_len, Register rscratch = noreg); + using Assembler::evporq; void evporq(XMMRegister dst, XMMRegister nds, AddressLiteral src, int vector_len, Register rscratch = noreg); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp index be3a5f0ea0f..d65d8e871c3 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.hpp @@ -364,7 +364,8 @@ class StubGenerator: public StubCodeGenerator { // Utility routine for increase 128bit counter (iv in CTR mode) void inc_counter(Register reg, XMMRegister xmmdst, int inc_delta, Label& next_block); - + void ev_add128(XMMRegister xmmdst, XMMRegister xmmsrc1, XMMRegister xmmsrc2, + int vector_len, KRegister ktmp, Register rscratch = noreg); void generate_aes_stubs(); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp index 3e1439f2a02..7b1fb54853e 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp @@ -121,6 +121,16 @@ static address counter_mask_linc32_addr() { return (address)COUNTER_MASK_LINC32; } +ATTRIBUTE_ALIGNED(64) uint64_t COUNTER_MASK_ONES[] = { + 0x0000000000000000UL, 0x0000000000000001UL, + 0x0000000000000000UL, 0x0000000000000001UL, + 0x0000000000000000UL, 0x0000000000000001UL, + 0x0000000000000000UL, 0x0000000000000001UL, +}; +static address counter_mask_ones_addr() { + return (address)COUNTER_MASK_ONES; +} + ATTRIBUTE_ALIGNED(64) static const uint64_t GHASH_POLYNOMIAL_REDUCTION[] = { 0x00000001C2000000UL, 0xC200000000000000UL, 0x00000001C2000000UL, 0xC200000000000000UL, @@ -1623,6 +1633,17 @@ void StubGenerator::ev_load_key(XMMRegister xmmdst, Register key, int offset, Re __ evshufi64x2(xmmdst, xmmdst, xmmdst, 0x0, Assembler::AVX_512bit); } +// Add 128-bit integers in xmmsrc1 to xmmsrc2, then place the result in xmmdst. +// Clobber ktmp and rscratch. +// Used by aesctr_encrypt. +void StubGenerator::ev_add128(XMMRegister xmmdst, XMMRegister xmmsrc1, XMMRegister xmmsrc2, + int vector_len, KRegister ktmp, Register rscratch) { + __ vpaddq(xmmdst, xmmsrc1, xmmsrc2, vector_len); + __ evpcmpuq(ktmp, xmmdst, xmmsrc2, __ lt, vector_len); + __ kshiftlbl(ktmp, ktmp, 1); + __ evpaddq(xmmdst, ktmp, xmmdst, ExternalAddress(counter_mask_ones_addr()), /*merge*/true, + vector_len, rscratch); +} // AES-ECB Encrypt Operation void StubGenerator::aesecb_encrypt(Register src_addr, Register dest_addr, Register key, Register len) { @@ -2046,7 +2067,6 @@ void StubGenerator::aesecb_decrypt(Register src_addr, Register dest_addr, Regist } - // AES Counter Mode using VAES instructions void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Register key, Register counter, Register len_reg, Register used, Register used_addr, Register saved_encCounter_start) { @@ -2104,14 +2124,17 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist // The counter is incremented after each block i.e. 16 bytes is processed; // each zmm register has 4 counter values as its MSB // the counters are incremented in parallel - __ vpaddd(xmm8, xmm8, ExternalAddress(counter_mask_linc0_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); - __ vpaddd(xmm9, xmm8, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); - __ vpaddd(xmm10, xmm9, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); - __ vpaddd(xmm11, xmm10, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); - __ vpaddd(xmm12, xmm11, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); - __ vpaddd(xmm13, xmm12, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); - __ vpaddd(xmm14, xmm13, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); - __ vpaddd(xmm15, xmm14, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + + __ evmovdquq(xmm19, ExternalAddress(counter_mask_linc0_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + __ evmovdquq(xmm19, ExternalAddress(counter_mask_linc4_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); + ev_add128(xmm9, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + ev_add128(xmm10, xmm9, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + ev_add128(xmm11, xmm10, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + ev_add128(xmm12, xmm11, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + ev_add128(xmm13, xmm12, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + ev_add128(xmm14, xmm13, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + ev_add128(xmm15, xmm14, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); // load linc32 mask in zmm register.linc32 increments counter by 32 __ evmovdquq(xmm19, ExternalAddress(counter_mask_linc32_addr()), Assembler::AVX_512bit, r15 /*rscratch*/); @@ -2159,21 +2182,21 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist // This is followed by incrementing counter values in zmm8-zmm15. // Since we will be processing 32 blocks at a time, the counter is incremented by 32. roundEnc(xmm21, 7); - __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_512bit); + ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); roundEnc(xmm22, 7); - __ vpaddq(xmm9, xmm9, xmm19, Assembler::AVX_512bit); + ev_add128(xmm9, xmm9, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); roundEnc(xmm23, 7); - __ vpaddq(xmm10, xmm10, xmm19, Assembler::AVX_512bit); + ev_add128(xmm10, xmm10, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); roundEnc(xmm24, 7); - __ vpaddq(xmm11, xmm11, xmm19, Assembler::AVX_512bit); + ev_add128(xmm11, xmm11, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); roundEnc(xmm25, 7); - __ vpaddq(xmm12, xmm12, xmm19, Assembler::AVX_512bit); + ev_add128(xmm12, xmm12, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); roundEnc(xmm26, 7); - __ vpaddq(xmm13, xmm13, xmm19, Assembler::AVX_512bit); + ev_add128(xmm13, xmm13, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); roundEnc(xmm27, 7); - __ vpaddq(xmm14, xmm14, xmm19, Assembler::AVX_512bit); + ev_add128(xmm14, xmm14, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); roundEnc(xmm28, 7); - __ vpaddq(xmm15, xmm15, xmm19, Assembler::AVX_512bit); + ev_add128(xmm15, xmm15, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); roundEnc(xmm29, 7); __ cmpl(rounds, 52); @@ -2251,8 +2274,8 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist __ vpshufb(xmm3, xmm11, xmm16, Assembler::AVX_512bit); __ evpxorq(xmm3, xmm3, xmm20, Assembler::AVX_512bit); // Increment counter values by 16 - __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_512bit); - __ vpaddq(xmm9, xmm9, xmm19, Assembler::AVX_512bit); + ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); + ev_add128(xmm9, xmm9, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); // AES encode rounds roundEnc(xmm21, 3); roundEnc(xmm22, 3); @@ -2319,7 +2342,7 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist __ vpshufb(xmm1, xmm9, xmm16, Assembler::AVX_512bit); __ evpxorq(xmm1, xmm1, xmm20, Assembler::AVX_512bit); // increment counter by 8 - __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_512bit); + ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); // AES encode roundEnc(xmm21, 1); roundEnc(xmm22, 1); @@ -2376,8 +2399,9 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist // XOR counter with first roundkey __ vpshufb(xmm0, xmm8, xmm16, Assembler::AVX_512bit); __ evpxorq(xmm0, xmm0, xmm20, Assembler::AVX_512bit); + // Increment counter - __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_512bit); + ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_512bit, /*ktmp*/k1, r15 /*rscratch*/); __ vaesenc(xmm0, xmm0, xmm21, Assembler::AVX_512bit); __ vaesenc(xmm0, xmm0, xmm22, Assembler::AVX_512bit); __ vaesenc(xmm0, xmm0, xmm23, Assembler::AVX_512bit); @@ -2427,7 +2451,7 @@ void StubGenerator::aesctr_encrypt(Register src_addr, Register dest_addr, Regist __ evpxorq(xmm0, xmm0, xmm20, Assembler::AVX_128bit); __ vaesenc(xmm0, xmm0, xmm21, Assembler::AVX_128bit); // Increment counter by 1 - __ vpaddq(xmm8, xmm8, xmm19, Assembler::AVX_128bit); + ev_add128(xmm8, xmm8, xmm19, Assembler::AVX_128bit, /*ktmp*/k1, r15 /*rscratch*/); __ vaesenc(xmm0, xmm0, xmm22, Assembler::AVX_128bit); __ vaesenc(xmm0, xmm0, xmm23, Assembler::AVX_128bit); __ vaesenc(xmm0, xmm0, xmm24, Assembler::AVX_128bit); From ef6db5c2991b92e2a600fa01d1d3f5026055ad17 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Wed, 16 Aug 2023 07:39:42 +0000 Subject: [PATCH 073/162] 8314211: Add NativeLibraryUnload event Reviewed-by: stuefe, mdoerr --- src/hotspot/os/posix/os_posix.cpp | 21 +++++++++++++++++++ src/hotspot/os/windows/os_windows.cpp | 21 +++++++++++++++++++ src/hotspot/share/jfr/metadata/metadata.xml | 7 +++++++ src/jdk.jfr/share/conf/jfr/default.jfc | 6 ++++++ src/jdk.jfr/share/conf/jfr/profile.jfc | 6 ++++++ .../metadata/TestLookForUntestedEvents.java | 4 ++-- test/lib/jdk/test/lib/jfr/EventNames.java | 1 + 7 files changed, 64 insertions(+), 2 deletions(-) diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 44b23bfadf3..3f9ffe303ac 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -49,6 +49,10 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include "utilities/vmError.hpp" +#if INCLUDE_JFR +#include "jfr/jfrEvents.hpp" +#endif + #ifdef AIX #include "loadlib_aix.hpp" #endif @@ -714,6 +718,7 @@ void os::dll_unload(void *lib) { // calling dlclose the dynamic loader may free the memory containing the string, thus we need to // copy the string to be able to reference it after dlclose. const char* l_path = nullptr; + #ifdef LINUX char* l_pathdup = nullptr; l_path = os::Linux::dll_path(lib); @@ -721,6 +726,12 @@ void os::dll_unload(void *lib) { l_path = l_pathdup = os::strdup(l_path); } #endif // LINUX + +#if INCLUDE_JFR + EventNativeLibraryUnload event; + event.set_name(l_path); +#endif + if (l_path == nullptr) { l_path = ""; } @@ -730,6 +741,11 @@ void os::dll_unload(void *lib) { Events::log_dll_message(nullptr, "Unloaded shared library \"%s\" [" INTPTR_FORMAT "]", l_path, p2i(lib)); log_info(os)("Unloaded shared library \"%s\" [" INTPTR_FORMAT "]", l_path, p2i(lib)); +#if INCLUDE_JFR + event.set_success(true); + event.set_errorMessage(nullptr); + event.commit(); +#endif } else { const char* error_report = ::dlerror(); if (error_report == nullptr) { @@ -740,6 +756,11 @@ void os::dll_unload(void *lib) { l_path, p2i(lib), error_report); log_info(os)("Attempt to unload shared library \"%s\" [" INTPTR_FORMAT "] failed, %s", l_path, p2i(lib), error_report); +#if INCLUDE_JFR + event.set_success(false); + event.set_errorMessage(error_report); + event.commit(); +#endif } // Update the dll cache AIX_ONLY(LoadedLibraries::reload()); diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 2c072bf8e60..2b457b6af2a 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -1254,13 +1254,34 @@ void os::dll_unload(void *lib) { if (::GetModuleFileName((HMODULE)lib, name, sizeof(name)) == 0) { snprintf(name, MAX_PATH, ""); } + +#if INCLUDE_JFR + EventNativeLibraryUnload event; + event.set_name(name); +#endif + if (::FreeLibrary((HMODULE)lib)) { Events::log_dll_message(nullptr, "Unloaded dll \"%s\" [" INTPTR_FORMAT "]", name, p2i(lib)); log_info(os)("Unloaded dll \"%s\" [" INTPTR_FORMAT "]", name, p2i(lib)); +#if INCLUDE_JFR + event.set_success(true); + event.set_errorMessage(nullptr); + event.commit(); +#endif } else { const DWORD errcode = ::GetLastError(); + char buf[500]; + size_t tl = os::lasterror(buf, sizeof(buf)); Events::log_dll_message(nullptr, "Attempt to unload dll \"%s\" [" INTPTR_FORMAT "] failed (error code %d)", name, p2i(lib), errcode); log_info(os)("Attempt to unload dll \"%s\" [" INTPTR_FORMAT "] failed (error code %d)", name, p2i(lib), errcode); +#if INCLUDE_JFR + event.set_success(false); + if (tl == 0) { + os::snprintf(buf, sizeof(buf), "Attempt to unload dll failed (error code %d)", (int) errcode); + } + event.set_errorMessage(buf); + event.commit(); +#endif } } diff --git a/src/hotspot/share/jfr/metadata/metadata.xml b/src/hotspot/share/jfr/metadata/metadata.xml index 70715294a5e..f8fc4e5bccd 100644 --- a/src/hotspot/share/jfr/metadata/metadata.xml +++ b/src/hotspot/share/jfr/metadata/metadata.xml @@ -946,6 +946,13 @@ + + + + + + diff --git a/src/jdk.jfr/share/conf/jfr/default.jfc b/src/jdk.jfr/share/conf/jfr/default.jfc index ba3eb50e53f..6b0aa1724c4 100644 --- a/src/jdk.jfr/share/conf/jfr/default.jfc +++ b/src/jdk.jfr/share/conf/jfr/default.jfc @@ -700,6 +700,12 @@ 0 ms + + true + true + 0 ms + + true endChunk diff --git a/src/jdk.jfr/share/conf/jfr/profile.jfc b/src/jdk.jfr/share/conf/jfr/profile.jfc index 5563b690569..79ce390052a 100644 --- a/src/jdk.jfr/share/conf/jfr/profile.jfc +++ b/src/jdk.jfr/share/conf/jfr/profile.jfc @@ -700,6 +700,12 @@ 0 ms + + true + true + 0 ms + + true endChunk diff --git a/test/jdk/jdk/jfr/event/metadata/TestLookForUntestedEvents.java b/test/jdk/jdk/jfr/event/metadata/TestLookForUntestedEvents.java index 0e0891615ac..bdb10a47259 100644 --- a/test/jdk/jdk/jfr/event/metadata/TestLookForUntestedEvents.java +++ b/test/jdk/jdk/jfr/event/metadata/TestLookForUntestedEvents.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ public class TestLookForUntestedEvents { private static final Set hardToTestEvents = new HashSet<>( Arrays.asList( - "DataLoss", "IntFlag", "ReservedStackActivation", + "DataLoss", "IntFlag", "ReservedStackActivation", "NativeLibraryUnload", "DoubleFlag", "UnsignedLongFlagChanged", "IntFlagChanged", "UnsignedIntFlag", "UnsignedIntFlagChanged", "DoubleFlagChanged") ); diff --git a/test/lib/jdk/test/lib/jfr/EventNames.java b/test/lib/jdk/test/lib/jfr/EventNames.java index f0978d189d7..9263c234e4b 100644 --- a/test/lib/jdk/test/lib/jfr/EventNames.java +++ b/test/lib/jdk/test/lib/jfr/EventNames.java @@ -184,6 +184,7 @@ public class EventNames { public static final String InitialEnvironmentVariable = PREFIX + "InitialEnvironmentVariable"; public static final String NativeLibrary = PREFIX + "NativeLibrary"; public static final String NativeLibraryLoad = PREFIX + "NativeLibraryLoad"; + public static final String NativeLibraryUnload = PREFIX + "NativeLibraryUnload"; public static final String PhysicalMemory = PREFIX + "PhysicalMemory"; public static final String NetworkUtilization = PREFIX + "NetworkUtilization"; public static final String ProcessStart = PREFIX + "ProcessStart"; From b80001de0c0aeedeb412430660a4727fc26be98b Mon Sep 17 00:00:00 2001 From: Raffaello Giulietti Date: Wed, 16 Aug 2023 08:21:34 +0000 Subject: [PATCH 074/162] 8314209: Wrong @since tag for RandomGenerator::equiDoubles Reviewed-by: alanb --- .../share/classes/java/util/random/RandomGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/util/random/RandomGenerator.java b/src/java.base/share/classes/java/util/random/RandomGenerator.java index 9574fd18594..b38c4eee8f0 100644 --- a/src/java.base/share/classes/java/util/random/RandomGenerator.java +++ b/src/java.base/share/classes/java/util/random/RandomGenerator.java @@ -293,7 +293,7 @@ default DoubleStream doubles(long streamSize, double randomNumberOrigin, * or {@code right} is not finite, or if the specified interval * is empty. * - * @since 21 + * @since 22 */ default DoubleStream equiDoubles(double left, double right, boolean isLeftIncluded, boolean isRightIncluded) { From 1925508425cf1b2d46173754077a588290253430 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Wed, 16 Aug 2023 12:08:56 +0000 Subject: [PATCH 075/162] 8314144: gc/g1/ihop/TestIHOPStatic.java fails due to extra concurrent mark with -Xcomp Reviewed-by: ayang, iwalulya --- test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java | 1 + test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java index 43dcdeeb788..a93232dd82e 100644 --- a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java +++ b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java @@ -30,6 +30,7 @@ * @requires !vm.flightRecorder * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @requires vm.opt.MaxGCPauseMillis == "null" + * @requires vm.compMode != "Xcomp" * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management diff --git a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java index b948448cadf..c84374fa359 100644 --- a/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java +++ b/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java @@ -28,7 +28,8 @@ * @requires vm.gc.G1 * @requires !vm.flightRecorder * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @requires !(vm.graal.enabled & vm.compMode == "Xcomp") + * @requires !vm.graal.enabled + * @requires vm.compMode != "Xcomp" * @requires os.maxMemory > 1G * @library /test/lib / * @modules java.base/jdk.internal.misc From 24e896d7c905de5030f1b62cf922c15bb7bef311 Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Wed, 16 Aug 2023 15:00:50 +0000 Subject: [PATCH 076/162] 8310275: Bug in assignment operator of ReservedMemoryRegion Reviewed-by: jsjolen, dholmes, stuefe --- .../share/services/virtualMemoryTracker.hpp | 1 + .../gtest/nmt/test_nmt_reserved_region.cpp | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 test/hotspot/gtest/nmt/test_nmt_reserved_region.cpp diff --git a/src/hotspot/share/services/virtualMemoryTracker.hpp b/src/hotspot/share/services/virtualMemoryTracker.hpp index de1a72f65aa..af9f8bdbfc0 100644 --- a/src/hotspot/share/services/virtualMemoryTracker.hpp +++ b/src/hotspot/share/services/virtualMemoryTracker.hpp @@ -333,6 +333,7 @@ class ReservedMemoryRegion : public VirtualMemoryRegion { _stack = *other.call_stack(); _flag = other.flag(); + _committed_regions.clear(); CommittedRegionIterator itr = other.iterate_committed_regions(); const CommittedMemoryRegion* rgn = itr.next(); diff --git a/test/hotspot/gtest/nmt/test_nmt_reserved_region.cpp b/test/hotspot/gtest/nmt/test_nmt_reserved_region.cpp new file mode 100644 index 00000000000..753a374fdbb --- /dev/null +++ b/test/hotspot/gtest/nmt/test_nmt_reserved_region.cpp @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2023 SAP SE. All rights reserved. + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "services/memTracker.hpp" +#include "services/virtualMemoryTracker.hpp" +#include "unittest.hpp" + +// Tests the assignment operator of ReservedMemoryRegion +TEST_VM(NMT, ReservedRegionCopy) { + address dummy1 = (address)0x10000000; + NativeCallStack stack1(&dummy1, 1); + ReservedMemoryRegion region1(dummy1, os::vm_page_size(), stack1, mtThreadStack); + VirtualMemorySummary::record_reserved_memory(os::vm_page_size(), region1.flag()); + region1.add_committed_region(dummy1, os::vm_page_size(), stack1); + address dummy2 = (address)0x20000000; + NativeCallStack stack2(&dummy2, 1); + ReservedMemoryRegion region2(dummy2, os::vm_page_size(), stack2, mtCode); + VirtualMemorySummary::record_reserved_memory(os::vm_page_size(), region2.flag()); + region2.add_committed_region(dummy2, os::vm_page_size(), stack2); + + region2 = region1; + + CommittedRegionIterator itr = region2.iterate_committed_regions(); + const CommittedMemoryRegion* rgn = itr.next(); + ASSERT_EQ(rgn->base(), dummy1); // Now we should see dummy1 + ASSERT_EQ(region2.flag(), mtThreadStack); // Should be correct flag + ASSERT_EQ(region2.call_stack()->get_frame(0), dummy1); // Check the stack + rgn = itr.next(); + ASSERT_EQ(rgn, (const CommittedMemoryRegion*)nullptr); // and nothing else +} + From 13f6450e2e70df4df8bd882def837fbd5bef1524 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Wed, 16 Aug 2023 15:42:36 +0000 Subject: [PATCH 077/162] 8313765: Invalid CEN header (invalid zip64 extra data field size) Reviewed-by: simonis, alanb, coffeys --- .../share/classes/java/util/zip/ZipFile.java | 52 +- .../classes/jdk/nio/zipfs/ZipFileSystem.java | 14 +- .../util/zip/ZipFile/CorruptedZipFiles.java | 18 +- .../ReadNonStandardExtraHeadersTest.java | 934 ++++++++++++++++++ 4 files changed, 1000 insertions(+), 18 deletions(-) create mode 100644 test/jdk/java/util/zip/ZipFile/ReadNonStandardExtraHeadersTest.java diff --git a/src/java.base/share/classes/java/util/zip/ZipFile.java b/src/java.base/share/classes/java/util/zip/ZipFile.java index 52d975005e0..cb9070fc885 100644 --- a/src/java.base/share/classes/java/util/zip/ZipFile.java +++ b/src/java.base/share/classes/java/util/zip/ZipFile.java @@ -69,7 +69,7 @@ import jdk.internal.vm.annotation.Stable; import sun.nio.cs.UTF_8; import sun.nio.fs.DefaultFileSystemProvider; -import sun.security.action.GetBooleanAction; +import sun.security.action.GetPropertyAction; import sun.security.util.SignatureFileVerifier; import static java.util.zip.ZipConstants64.*; @@ -123,11 +123,12 @@ public class ZipFile implements ZipConstants, Closeable { public static final int OPEN_DELETE = 0x4; /** - * Flag which specifies whether the validation of the Zip64 extra - * fields should be disabled + * Flag to specify whether the Extra ZIP64 validation should be + * disabled. */ - private static final boolean disableZip64ExtraFieldValidation = - GetBooleanAction.privilegedGetProperty("jdk.util.zip.disableZip64ExtraFieldValidation"); + private static final boolean DISABLE_ZIP64_EXTRA_VALIDATION = + getDisableZip64ExtraFieldValidation(); + /** * Opens a zip file for reading. * @@ -1092,6 +1093,22 @@ private int[] getMetaInfVersions() { } } + /** + * Returns the value of the System property which indicates whether the + * Extra ZIP64 validation should be disabled. + */ + static boolean getDisableZip64ExtraFieldValidation() { + boolean result; + String value = GetPropertyAction.privilegedGetProperty( + "jdk.util.zip.disableZip64ExtraFieldValidation"); + if (value == null) { + result = false; + } else { + result = value.isEmpty() || value.equalsIgnoreCase("true"); + } + return result; + } + static { SharedSecrets.setJavaUtilZipFileAccess( new JavaUtilZipFileAccess() { @@ -1208,7 +1225,7 @@ private int checkAndAddEntry(int pos, int index) } int elen = CENEXT(cen, pos); - if (elen > 0 && !disableZip64ExtraFieldValidation) { + if (elen > 0 && !DISABLE_ZIP64_EXTRA_VALIDATION) { long extraStartingOffset = pos + CENHDR + nlen; if ((int)extraStartingOffset != extraStartingOffset) { zerror("invalid CEN header (bad extra offset)"); @@ -1260,25 +1277,32 @@ private void checkExtraFields(int cenPos, int startingOffset, zerror("Invalid CEN header (extra data field size too long)"); } int currentOffset = startingOffset; - while (currentOffset < extraEndOffset) { + // Walk through each Extra Header. Each Extra Header Must consist of: + // Header ID - 2 bytes + // Data Size - 2 bytes: + while (currentOffset + Integer.BYTES <= extraEndOffset) { int tag = get16(cen, currentOffset); currentOffset += Short.BYTES; int tagBlockSize = get16(cen, currentOffset); + currentOffset += Short.BYTES; int tagBlockEndingOffset = currentOffset + tagBlockSize; // The ending offset for this tag block should not go past the // offset for the end of the extra field if (tagBlockEndingOffset > extraEndOffset) { - zerror("Invalid CEN header (invalid zip64 extra data field size)"); + zerror(String.format( + "Invalid CEN header (invalid extra data field size for " + + "tag: 0x%04x at %d)", + tag, cenPos)); } - currentOffset += Short.BYTES; if (tag == ZIP64_EXTID) { // Get the compressed size; long csize = CENSIZ(cen, cenPos); // Get the uncompressed size; long size = CENLEN(cen, cenPos); + checkZip64ExtraFieldValues(currentOffset, tagBlockSize, csize, size); } @@ -1302,6 +1326,16 @@ private void checkZip64ExtraFieldValues(int off, int blockSize, long csize, long size) throws ZipException { byte[] cen = this.cen; + // if ZIP64_EXTID blocksize == 0, which may occur with some older + // versions of Apache Ant and Commons Compress, validate csize and size + // to make sure neither field == ZIP64_MAGICVAL + if (blockSize == 0) { + if (csize == ZIP64_MAGICVAL || size == ZIP64_MAGICVAL) { + zerror("Invalid CEN header (invalid zip64 extra data field size)"); + } + // Only validate the ZIP64_EXTID data if the block size > 0 + return; + } // Validate the Zip64 Extended Information Extra Field (0x0001) // length. if (!isZip64ExtBlockSizeValid(blockSize)) { diff --git a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java index 03b2a3c0f57..c1a13c8627d 100644 --- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java +++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java @@ -3085,10 +3085,22 @@ private void readExtra(ZipFileSystem zipfs) throws IOException { int sz = SH(extra, pos + 2); pos += 4; if (pos + sz > elen) { // invalid data - throw new ZipException("Invalid CEN header (invalid zip64 extra data field size)"); + throw new ZipException(String.format( + "Invalid CEN header (invalid extra data field size for " + + "tag: 0x%04x size: %d)", + tag, sz)); } switch (tag) { case EXTID_ZIP64 : + // if ZIP64_EXTID blocksize == 0, which may occur with some older + // versions of Apache Ant and Commons Compress, validate csize + // size, and locoff to make sure the fields != ZIP64_MAGICVAL + if (sz == 0) { + if (csize == ZIP64_MINVAL || size == ZIP64_MINVAL || locoff == ZIP64_MINVAL) { + throw new ZipException("Invalid CEN header (invalid zip64 extra data field size)"); + } + break; + } // Check to see if we have a valid block size if (!isZip64ExtBlockSizeValid(sz)) { throw new ZipException("Invalid CEN header (invalid zip64 extra data field size)"); diff --git a/test/jdk/java/util/zip/ZipFile/CorruptedZipFiles.java b/test/jdk/java/util/zip/ZipFile/CorruptedZipFiles.java index 8885e739be1..befdf4cac15 100644 --- a/test/jdk/java/util/zip/ZipFile/CorruptedZipFiles.java +++ b/test/jdk/java/util/zip/ZipFile/CorruptedZipFiles.java @@ -22,24 +22,26 @@ */ /* @test - * @bug 4770745 6218846 6218848 6237956 + * @bug 4770745 6218846 6218848 6237956 8313765 * @summary test for correct detection and reporting of corrupted zip files * @author Martin Buchholz * @run junit CorruptedZipFiles */ -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; @@ -258,9 +260,9 @@ public void insufficientFilenameLength() throws IOException { */ @Test public void excessiveExtraFieldLength() throws IOException { - short existingExtraLength = buffer.getShort(cenpos + CENEXT); - buffer.putShort(cenpos+CENEXT, (short) (existingExtraLength + 1)); - assertZipException(".*invalid zip64 extra data field size.*"); + buffer.put(cenpos+CENEXT, (byte) 0xff); + buffer.put(cenpos+CENEXT+1, (byte) 0xff); + assertZipException(".*extra data field size too long.*"); } /* diff --git a/test/jdk/java/util/zip/ZipFile/ReadNonStandardExtraHeadersTest.java b/test/jdk/java/util/zip/ZipFile/ReadNonStandardExtraHeadersTest.java new file mode 100644 index 00000000000..2208facc269 --- /dev/null +++ b/test/jdk/java/util/zip/ZipFile/ReadNonStandardExtraHeadersTest.java @@ -0,0 +1,934 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.IOException; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Formatter; +import java.util.Map; +import java.util.stream.Stream; +import java.util.zip.ZipFile; + +/* @test + * @bug 8313765 + * @summary Validate that a Zip File with an Extra Header with a data size + * of 0 can be read. + * @run junit ReadNonStandardExtraHeadersTest + */ +public class ReadNonStandardExtraHeadersTest { + + /* + * Byte array holding a ZIP file which contains an + * Extra field header which has a data size of 0. + * + * ---------------#1-------------------- + * [Central Directory Header] + * 0x664: Signature : 0x02014b50 + * 0x668: Created Zip Spec : 0xa [1.0] + * 0x669: Created OS : 0x0 [MS-DOS] + * 0x66a: VerMadeby : 0xa [0, 1.0] + * 0x66b: VerExtract : 0xa [1.0] + * 0x66c: Flag : 0x800 + * 0x66e: Method : 0x0 [STORED] + * 0x670: Last Mod Time : 0x385ca437 [Thu Feb 28 20:33:46 EST 2008] + * 0x674: CRC : 0x694c6952 + * 0x678: Compressed Size : 0x624 + * 0x67c: Uncompressed Size: 0x624 + * 0x680: Name Length : 0x1b + * 0x682: Extra Length : 0x7 + * ->[tag=cafe, size=0] + * 0x684: Comment Length : 0x0 + * 0x686: Disk Start : 0x0 + * 0x688: Attrs : 0x0 + * 0x68a: AttrsEx : 0x0 + * 0x68e: Loc Header Offset: 0x0 + * 0x692: File Name : res/drawable/size_48x48.jpg + * + * [Local File Header] + * 0x0: Signature : 0x04034b50 + * 0x4: Version : 0xa [1.0] + * 0x6: Flag : 0x800 + * 0x8: Method : 0x0 [STORED] + * 0xa: LastMTime : 0x385ca437 [Thu Feb 28 20:33:46 EST 2008] + * 0xe: CRC : 0x694c6952 + * 0x12: CSize : 0x624 + * 0x16: Size : 0x624 + * 0x1a: Name Length : 0x1b [res/drawable/size_48x48.jpg] + * 0x1c: ExtraLength : 0x7 + * ->[tag=cafe, size=0] + * 0x1e: File Name : [res/drawable/size_48x48.jpg] + * [End Central Directory Header] + * Signature : 0x06054b50 + * ENDCEN Off : 0x6b4 + * Disk Entries: 0x1 + * Total Entries: 0x1 + * CEN Size : 0x50 + * Offset CEN : 0x664 + * Comment Len : 0x0 [] + */ + public static byte[] VALID_APK_FILE = { + (byte) 0x50, (byte) 0x4b, (byte) 0x3, (byte) 0x4, (byte) 0xa, (byte) 0x0, (byte) 0x0, (byte) 0x8, + (byte) 0x0, (byte) 0x0, (byte) 0x37, (byte) 0xa4, (byte) 0x5c, (byte) 0x38, (byte) 0x52, (byte) 0x69, + (byte) 0x4c, (byte) 0x69, (byte) 0x24, (byte) 0x6, (byte) 0x0, (byte) 0x0, (byte) 0x24, (byte) 0x6, + (byte) 0x0, (byte) 0x0, (byte) 0x1b, (byte) 0x0, (byte) 0x7, (byte) 0x0, (byte) 0x72, (byte) 0x65, + (byte) 0x73, (byte) 0x2f, (byte) 0x64, (byte) 0x72, (byte) 0x61, (byte) 0x77, (byte) 0x61, (byte) 0x62, + (byte) 0x6c, (byte) 0x65, (byte) 0x2f, (byte) 0x73, (byte) 0x69, (byte) 0x7a, (byte) 0x65, (byte) 0x5f, + (byte) 0x34, (byte) 0x38, (byte) 0x78, (byte) 0x34, (byte) 0x38, (byte) 0x2e, (byte) 0x6a, (byte) 0x70, + (byte) 0x67, (byte) 0xfe, (byte) 0xca, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0xff, (byte) 0xd8, (byte) 0xff, (byte) 0xe0, (byte) 0x0, (byte) 0x10, (byte) 0x4a, (byte) 0x46, + (byte) 0x49, (byte) 0x46, (byte) 0x0, (byte) 0x1, (byte) 0x1, (byte) 0x1, (byte) 0x0, (byte) 0x48, + (byte) 0x0, (byte) 0x48, (byte) 0x0, (byte) 0x0, (byte) 0xff, (byte) 0xfe, (byte) 0x0, (byte) 0x16, + (byte) 0x28, (byte) 0x63, (byte) 0x29, (byte) 0x20, (byte) 0x32, (byte) 0x30, (byte) 0x30, (byte) 0x37, + (byte) 0x20, (byte) 0x50, (byte) 0x68, (byte) 0x69, (byte) 0x6c, (byte) 0x20, (byte) 0x44, (byte) 0x75, + (byte) 0x62, (byte) 0x61, (byte) 0x63, (byte) 0x68, (byte) 0xff, (byte) 0xdb, (byte) 0x0, (byte) 0x43, + (byte) 0x0, (byte) 0x6, (byte) 0x4, (byte) 0x5, (byte) 0x6, (byte) 0x5, (byte) 0x4, (byte) 0x6, + (byte) 0x6, (byte) 0x5, (byte) 0x6, (byte) 0x7, (byte) 0x7, (byte) 0x6, (byte) 0x8, (byte) 0xa, + (byte) 0x10, (byte) 0xa, (byte) 0xa, (byte) 0x9, (byte) 0x9, (byte) 0xa, (byte) 0x14, (byte) 0xe, + (byte) 0xf, (byte) 0xc, (byte) 0x10, (byte) 0x17, (byte) 0x14, (byte) 0x18, (byte) 0x18, (byte) 0x17, + (byte) 0x14, (byte) 0x16, (byte) 0x16, (byte) 0x1a, (byte) 0x1d, (byte) 0x25, (byte) 0x1f, (byte) 0x1a, + (byte) 0x1b, (byte) 0x23, (byte) 0x1c, (byte) 0x16, (byte) 0x16, (byte) 0x20, (byte) 0x2c, (byte) 0x20, + (byte) 0x23, (byte) 0x26, (byte) 0x27, (byte) 0x29, (byte) 0x2a, (byte) 0x29, (byte) 0x19, (byte) 0x1f, + (byte) 0x2d, (byte) 0x30, (byte) 0x2d, (byte) 0x28, (byte) 0x30, (byte) 0x25, (byte) 0x28, (byte) 0x29, + (byte) 0x28, (byte) 0xff, (byte) 0xdb, (byte) 0x0, (byte) 0x43, (byte) 0x1, (byte) 0x7, (byte) 0x7, + (byte) 0x7, (byte) 0xa, (byte) 0x8, (byte) 0xa, (byte) 0x13, (byte) 0xa, (byte) 0xa, (byte) 0x13, + (byte) 0x28, (byte) 0x1a, (byte) 0x16, (byte) 0x1a, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, + (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, + (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, + (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, + (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, + (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, + (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0x28, (byte) 0xff, (byte) 0xc0, + (byte) 0x0, (byte) 0x11, (byte) 0x8, (byte) 0x0, (byte) 0x30, (byte) 0x0, (byte) 0x30, (byte) 0x3, + (byte) 0x1, (byte) 0x11, (byte) 0x0, (byte) 0x2, (byte) 0x11, (byte) 0x1, (byte) 0x3, (byte) 0x11, + (byte) 0x1, (byte) 0xff, (byte) 0xc4, (byte) 0x0, (byte) 0x1b, (byte) 0x0, (byte) 0x0, (byte) 0x2, + (byte) 0x2, (byte) 0x3, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x4, (byte) 0x5, + (byte) 0x6, (byte) 0x7, (byte) 0x1, (byte) 0x3, (byte) 0x8, (byte) 0x2, (byte) 0xff, (byte) 0xc4, + (byte) 0x0, (byte) 0x2e, (byte) 0x10, (byte) 0x0, (byte) 0x2, (byte) 0x2, (byte) 0x1, (byte) 0x2, + (byte) 0x4, (byte) 0x4, (byte) 0x5, (byte) 0x4, (byte) 0x3, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x2, (byte) 0x3, (byte) 0x4, (byte) 0x11, + (byte) 0x0, (byte) 0x5, (byte) 0x6, (byte) 0x12, (byte) 0x21, (byte) 0x31, (byte) 0x41, (byte) 0x51, + (byte) 0x61, (byte) 0x71, (byte) 0x7, (byte) 0x13, (byte) 0x22, (byte) 0x42, (byte) 0x91, (byte) 0x33, + (byte) 0x62, (byte) 0x81, (byte) 0xa1, (byte) 0x52, (byte) 0xd1, (byte) 0xf0, (byte) 0xff, (byte) 0xc4, + (byte) 0x0, (byte) 0x1b, (byte) 0x1, (byte) 0x0, (byte) 0x1, (byte) 0x5, (byte) 0x1, (byte) 0x1, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x6, (byte) 0x2, (byte) 0x3, (byte) 0x4, (byte) 0x5, + (byte) 0x7, (byte) 0x1, (byte) 0x0, (byte) 0xff, (byte) 0xc4, (byte) 0x0, (byte) 0x33, (byte) 0x11, + (byte) 0x0, (byte) 0x1, (byte) 0x3, (byte) 0x2, (byte) 0x4, (byte) 0x4, (byte) 0x4, (byte) 0x4, + (byte) 0x5, (byte) 0x5, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x1, (byte) 0x0, (byte) 0x2, (byte) 0x3, (byte) 0x4, (byte) 0x11, (byte) 0x5, (byte) 0x12, + (byte) 0x21, (byte) 0x31, (byte) 0x13, (byte) 0x51, (byte) 0x61, (byte) 0x71, (byte) 0x6, (byte) 0x32, + (byte) 0x41, (byte) 0x81, (byte) 0x91, (byte) 0xa1, (byte) 0xb1, (byte) 0xc1, (byte) 0x7, (byte) 0x14, + (byte) 0x42, (byte) 0xd1, (byte) 0xf0, (byte) 0x22, (byte) 0x33, (byte) 0x62, (byte) 0xa2, (byte) 0xf1, + (byte) 0xff, (byte) 0xda, (byte) 0x0, (byte) 0xc, (byte) 0x3, (byte) 0x1, (byte) 0x0, (byte) 0x2, + (byte) 0x11, (byte) 0x3, (byte) 0x11, (byte) 0x0, (byte) 0x3f, (byte) 0x0, (byte) 0xb4, (byte) 0x11, + (byte) 0xf4, (byte) 0x4c, (byte) 0xa, (byte) 0x12, (byte) 0x7b, (byte) 0x16, (byte) 0x2e, (byte) 0x5d, + (byte) 0xaf, (byte) 0x46, (byte) 0xac, (byte) 0x96, (byte) 0x6e, (byte) 0xcf, (byte) 0x1c, (byte) 0x10, + (byte) 0x46, (byte) 0x32, (byte) 0xd2, (byte) 0x48, (byte) 0xd8, (byte) 0x3, (byte) 0x48, (byte) 0x96, + (byte) 0x46, (byte) 0x44, (byte) 0xd2, (byte) 0xf7, (byte) 0x9b, (byte) 0x0, (byte) 0x91, (byte) 0x5, + (byte) 0x24, (byte) 0xd5, (byte) 0x52, (byte) 0x8, (byte) 0x60, (byte) 0x69, (byte) 0x73, (byte) 0x8e, + (byte) 0xc0, (byte) 0x6f, (byte) 0xfc, (byte) 0xfa, (byte) 0x28, (byte) 0x26, (byte) 0xe5, (byte) 0xf1, + (byte) 0x5f, (byte) 0x6b, (byte) 0x82, (byte) 0x52, (byte) 0x9b, (byte) 0x7d, (byte) 0x3b, (byte) 0x17, + (byte) 0x0, (byte) 0x38, (byte) 0xe7, (byte) 0x62, (byte) 0x22, (byte) 0x53, (byte) 0xea, (byte) 0x32, + (byte) 0x9, (byte) 0xfc, (byte) 0x81, (byte) 0xaa, (byte) 0x19, (byte) 0xfc, (byte) 0x43, (byte) 0x13, + (byte) 0xd, (byte) 0xa3, (byte) 0x69, (byte) 0x77, (byte) 0xcb, (byte) 0xf7, (byte) 0x47, (byte) 0xb4, + (byte) 0x1f, (byte) 0x86, (byte) 0x95, (byte) 0xd3, (byte) 0xb7, (byte) 0x35, (byte) 0x4c, (byte) 0xad, + (byte) 0x8f, (byte) 0xa5, (byte) 0xb3, (byte) 0x1f, (byte) 0x7d, (byte) 0x40, (byte) 0xf8, (byte) 0x12, + (byte) 0x8a, (byte) 0xd9, (byte) 0x7e, (byte) 0x26, (byte) 0x6d, (byte) 0xb7, (byte) 0x98, (byte) 0x8b, + (byte) 0x95, (byte) 0x2c, (byte) 0xd3, (byte) 0x3, (byte) 0xbc, (byte) 0x9f, (byte) 0xaa, (byte) 0x8b, + (byte) 0xee, (byte) 0x40, (byte) 0xc8, (byte) 0xfc, (byte) 0x6b, (byte) 0xb4, (byte) 0xf8, (byte) 0xfc, + (byte) 0x52, (byte) 0x7f, (byte) 0x71, (byte) 0xa5, (byte) 0xbd, (byte) 0x77, (byte) 0x1e, (byte) 0xff, + (byte) 0x0, (byte) 0xf1, (byte) 0x7b, (byte) 0x10, (byte) 0xfc, (byte) 0x34, (byte) 0xc4, (byte) 0x29, + (byte) 0x9b, (byte) 0x9e, (byte) 0x9a, (byte) 0x46, (byte) 0xcb, (byte) 0xd3, (byte) 0xca, (byte) 0xef, + (byte) 0x6b, (byte) 0x92, (byte) 0xf, (byte) 0xc4, (byte) 0x29, (byte) 0xd4, (byte) 0x13, (byte) 0x47, + (byte) 0x62, (byte) 0x14, (byte) 0x9a, (byte) 0x9, (byte) 0x12, (byte) 0x58, (byte) 0x9c, (byte) 0x73, + (byte) 0x2b, (byte) 0xa1, (byte) 0x4, (byte) 0x30, (byte) 0xf3, (byte) 0x7, (byte) 0x57, (byte) 0xac, + (byte) 0x7b, (byte) 0x5e, (byte) 0xd0, (byte) 0xe6, (byte) 0x9b, (byte) 0x82, (byte) 0x80, (byte) 0x24, + (byte) 0x82, (byte) 0x48, (byte) 0x1e, (byte) 0x62, (byte) 0x95, (byte) 0xa5, (byte) 0xae, (byte) 0x1a, + (byte) 0x10, (byte) 0x45, (byte) 0x88, (byte) 0x3d, (byte) 0x42, (byte) 0xf7, (byte) 0x83, (byte) 0xae, + (byte) 0xdd, (byte) 0x75, (byte) 0xa1, (byte) 0x2, (byte) 0xd2, (byte) 0x47, (byte) 0x1a, (byte) 0x33, + (byte) 0xbb, (byte) 0x5, (byte) 0x45, (byte) 0x5, (byte) 0x99, (byte) 0x89, (byte) 0xc0, (byte) 0x0, + (byte) 0x77, (byte) 0x27, (byte) 0x49, (byte) 0xce, (byte) 0x0, (byte) 0xb9, (byte) 0x53, (byte) 0xcc, + (byte) 0x2e, (byte) 0x71, (byte) 0xb0, (byte) 0x17, (byte) 0x25, (byte) 0x73, (byte) 0xff, (byte) 0x0, + (byte) 0x1d, (byte) 0x71, (byte) 0x54, (byte) 0xfc, (byte) 0x4f, (byte) 0xba, (byte) 0x30, (byte) 0x46, + (byte) 0x64, (byte) 0xdb, (byte) 0x21, (byte) 0x62, (byte) 0x2b, (byte) 0xc5, (byte) 0xdb, (byte) 0x3f, + (byte) 0xbd, (byte) 0x87, (byte) 0xf9, (byte) 0x1f, (byte) 0xe8, (byte) 0x74, (byte) 0xf3, (byte) 0xc8, + (byte) 0x46, (byte) 0x25, (byte) 0x5e, (byte) 0xea, (byte) 0xb9, (byte) 0x3f, (byte) 0xc4, (byte) 0x6c, + (byte) 0x3e, (byte) 0xeb, (byte) 0x6d, (byte) 0xf0, (byte) 0xbf, (byte) 0x87, (byte) 0xa3, (byte) 0xc2, + (byte) 0xa0, (byte) 0x5, (byte) 0xc2, (byte) 0xf2, (byte) 0xbb, (byte) 0xcc, (byte) 0x7e, (byte) 0xc3, + (byte) 0xa0, (byte) 0xf9, (byte) 0x9d, (byte) 0x79, (byte) 0x59, (byte) 0xa, (byte) 0x2e, (byte) 0x7, + (byte) 0x4d, (byte) 0x54, (byte) 0x92, (byte) 0x8c, (byte) 0xd8, (byte) 0xdb, (byte) 0x29, (byte) 0x1f, + (byte) 0xe, (byte) 0x55, (byte) 0xbc, (byte) 0x86, (byte) 0x69, (byte) 0xea, (byte) 0x30, (byte) 0xc, + (byte) 0x22, (byte) 0x62, (byte) 0x63, (byte) 0x75, (byte) 0x24, (byte) 0x48, (byte) 0x83, (byte) 0xbe, + (byte) 0x7d, (byte) 0x3b, (byte) 0x75, (byte) 0x3e, (byte) 0x24, (byte) 0xe, (byte) 0xe4, (byte) 0x69, + (byte) 0xe8, (byte) 0xc, (byte) 0x8c, (byte) 0xbb, (byte) 0xd8, (byte) 0xa2, (byte) 0x56, (byte) 0x54, + (byte) 0xd3, (byte) 0x87, (byte) 0x32, (byte) 0x9, (byte) 0x4e, (byte) 0xae, (byte) 0x3a, (byte) 0x5b, + (byte) 0xd3, (byte) 0xaa, (byte) 0x7f, (byte) 0xc0, (byte) 0x7c, (byte) 0x5e, (byte) 0xdb, (byte) 0x2d, + (byte) 0xd1, (byte) 0x5, (byte) 0xd9, (byte) 0x11, (byte) 0x36, (byte) 0xb9, (byte) 0x64, (byte) 0xc3, + (byte) 0x87, (byte) 0x6c, (byte) 0x8, (byte) 0x89, (byte) 0xfb, (byte) 0x86, (byte) 0x7b, (byte) 0xf, + (byte) 0x3d, (byte) 0x59, (byte) 0xe1, (byte) 0x38, (byte) 0x8b, (byte) 0xa0, (byte) 0x7e, (byte) 0x43, + (byte) 0xe5, (byte) 0x3e, (byte) 0x9c, (byte) 0xba, (byte) 0xa1, (byte) 0x6f, (byte) 0x1b, (byte) 0x78, + (byte) 0x6e, (byte) 0x9a, (byte) 0xbe, (byte) 0x98, (byte) 0xd5, (byte) 0x5c, (byte) 0x36, (byte) 0x66, + (byte) 0xd, (byte) 0x9, (byte) 0xb0, (byte) 0xcd, (byte) 0x6f, (byte) 0xd2, (byte) 0x6f, (byte) 0xfe, + (byte) 0xbc, (byte) 0x8f, (byte) 0x4b, (byte) 0xab, (byte) 0xa6, (byte) 0xad, (byte) 0x9a, (byte) 0xf7, + (byte) 0x2b, (byte) 0xa4, (byte) 0xf4, (byte) 0xe7, (byte) 0x86, (byte) 0xc4, (byte) 0xf, (byte) 0xd5, + (byte) 0x65, (byte) 0x85, (byte) 0xc3, (byte) 0xab, (byte) 0x7b, (byte) 0x11, (byte) 0xd0, (byte) 0xe8, + (byte) 0xc5, (byte) 0xaf, (byte) 0xe, (byte) 0x17, (byte) 0x69, (byte) 0xba, (byte) 0xc2, (byte) 0xf2, + (byte) 0x16, (byte) 0x9b, (byte) 0x38, (byte) 0x59, (byte) 0x40, (byte) 0x78, (byte) 0xd6, (byte) 0xf3, + (byte) 0xa7, (byte) 0x8, (byte) 0xee, (byte) 0xe6, (byte) 0x33, (byte) 0xf5, (byte) 0x1a, (byte) 0xec, + (byte) 0xbd, (byte) 0x3c, (byte) 0x8f, (byte) 0x43, (byte) 0xfd, (byte) 0x13, (byte) 0xaa, (byte) 0xea, + (byte) 0xd9, (byte) 0x4f, (byte) 0x1, (byte) 0xe0, (byte) 0x72, (byte) 0x45, (byte) 0x78, (byte) 0x4c, + (byte) 0x2d, (byte) 0xfc, (byte) 0xf4, (byte) 0x39, (byte) 0xb6, (byte) 0xcc, (byte) 0x3e, (byte) 0x5b, + (byte) 0x7c, (byte) 0xd5, (byte) 0xb, (byte) 0x59, (byte) 0xb3, (byte) 0xa0, (byte) 0xd7, (byte) 0x85, + (byte) 0xb5, (byte) 0x53, (byte) 0x3e, (byte) 0xe9, (byte) 0xe6, (byte) 0xc6, (byte) 0x6a, (byte) 0x35, + (byte) 0xe4, (byte) 0x5d, (byte) 0xc1, (byte) 0x9d, (byte) 0x6b, (byte) 0xb0, (byte) 0x21, (byte) 0x9a, + (byte) 0x3c, (byte) 0x64, (byte) 0x7a, (byte) 0x8c, (byte) 0xe9, (byte) 0xa6, (byte) 0xe5, (byte) 0x7, + (byte) 0xfa, (byte) 0xb6, (byte) 0x53, (byte) 0xe5, (byte) 0x74, (byte) 0x9c, (byte) 0x33, (byte) 0xc2, + (byte) 0xf3, (byte) 0x75, (byte) 0x5b, (byte) 0xa5, (byte) 0xdf, (byte) 0x61, (byte) 0xda, (byte) 0x4f, + (byte) 0xc9, (byte) 0xb7, (byte) 0x3d, (byte) 0xc6, (byte) 0x4b, (byte) 0x32, (byte) 0x34, (byte) 0xb, + (byte) 0x65, (byte) 0x47, (byte) 0x53, (byte) 0x0, (byte) 0xc1, (byte) 0x18, (byte) 0xcf, (byte) 0x7f, + (byte) 0xbb, (byte) 0xa7, (byte) 0x99, (byte) 0xf5, (byte) 0x3a, (byte) 0x71, (byte) 0xb1, (byte) 0x49, + (byte) 0x35, (byte) 0xf2, (byte) 0x1d, (byte) 0x96, (byte) 0x6f, (byte) 0x8d, (byte) 0x62, (byte) 0x2f, + (byte) 0xa2, (byte) 0xc5, (byte) 0x44, (byte) 0xf1, (byte) 0x58, (byte) 0x90, (byte) 0xdb, (byte) 0x5b, + (byte) 0x70, (byte) 0xe, (byte) 0xbb, (byte) 0xf5, (byte) 0x6, (byte) 0xc5, (byte) 0x19, (byte) 0xc5, + (byte) 0xd4, (byte) 0xf6, (byte) 0xad, (byte) 0xbe, (byte) 0x18, (byte) 0x2d, (byte) 0x52, (byte) 0x13, + (byte) 0xd9, (byte) 0x2e, (byte) 0x3, (byte) 0x27, (byte) 0x2c, (byte) 0x79, (byte) 0x3c, (byte) 0x84, + (byte) 0x2, (byte) 0xf, (byte) 0x29, (byte) 0x39, (byte) 0xd, (byte) 0xea, (byte) 0x7d, (byte) 0x3b, + (byte) 0x75, (byte) 0xcb, (byte) 0x70, (byte) 0xe7, (byte) 0x75, (byte) 0xe2, (byte) 0x6, (byte) 0xdc, + (byte) 0xfd, (byte) 0x2, (byte) 0x8d, (byte) 0x84, (byte) 0xe2, (byte) 0x74, (byte) 0xfc, (byte) 0x73, + (byte) 0x55, (byte) 0x5d, (byte) 0x1b, (byte) 0xa6, (byte) 0x94, (byte) 0xed, (byte) 0xb1, (byte) 0xb7, + (byte) 0x60, (byte) 0x4f, (byte) 0xc3, (byte) 0x4d, (byte) 0x3d, (byte) 0x2, (byte) 0xb9, (byte) 0xf8, + (byte) 0x3, (byte) 0x88, (byte) 0xdb, (byte) 0x88, (byte) 0xf6, (byte) 0x48, (byte) 0x67, (byte) 0x6d, + (byte) 0xaf, (byte) 0x72, (byte) 0xa5, (byte) 0xcb, (byte) 0x1a, (byte) 0xab, (byte) 0x49, (byte) 0x6e, + (byte) 0x25, (byte) 0x45, (byte) 0x99, (byte) 0x80, (byte) 0xc3, (byte) 0x14, (byte) 0xc3, (byte) 0x12, + (byte) 0x46, (byte) 0x41, (byte) 0xee, (byte) 0x6, (byte) 0x8f, (byte) 0x68, (byte) 0xe7, (byte) 0x32, + (byte) 0xc4, (byte) 0xd2, (byte) 0x79, (byte) 0x6f, (byte) 0xe8, (byte) 0x4a, (byte) 0x2, (byte) 0xc5, + (byte) 0x29, (byte) 0x44, (byte) 0x15, (byte) 0x52, (byte) 0x34, (byte) 0x2, (byte) 0xd1, (byte) 0x72, + (byte) 0x43, (byte) 0x48, (byte) 0xb1, (byte) 0x0, (byte) 0xea, (byte) 0x1, (byte) 0x1d, (byte) 0x88, + (byte) 0x49, (byte) 0xae, (byte) 0xc0, (byte) 0x96, (byte) 0xea, (byte) 0x4f, (byte) 0x5a, (byte) 0x6f, + (byte) 0xd2, (byte) 0x9a, (byte) 0x36, (byte) 0x8d, (byte) 0xbd, (byte) 0x88, (byte) 0xc1, (byte) 0xd4, + (byte) 0x77, (byte) 0x8c, (byte) 0xcd, (byte) 0x2d, (byte) 0x3e, (byte) 0xaa, (byte) 0xce, (byte) 0x37, + (byte) 0x18, (byte) 0x9e, (byte) 0x24, (byte) 0x6e, (byte) 0xe0, (byte) 0xdf, (byte) 0xe0, (byte) 0xb9, + (byte) 0xfa, (byte) 0x4a, (byte) 0xf3, (byte) 0x50, (byte) 0xbd, (byte) 0x3d, (byte) 0x4b, (byte) 0x0, + (byte) 0xac, (byte) 0xd0, (byte) 0xb9, (byte) 0x46, (byte) 0x1e, (byte) 0xa3, (byte) 0xc7, (byte) 0xdb, + (byte) 0x42, (byte) 0xd3, (byte) 0x30, (byte) 0xb4, (byte) 0x90, (byte) 0x56, (byte) 0xaf, (byte) 0x86, + (byte) 0xd4, (byte) 0x89, (byte) 0x58, (byte) 0x1e, (byte) 0xd3, (byte) 0xa1, (byte) 0x4c, (byte) 0x76, + (byte) 0xe1, (byte) 0x1b, (byte) 0xdc, (byte) 0x84, (byte) 0xd9, (byte) 0x23, (byte) 0xe4, (byte) 0x2b, + (byte) 0x7, (byte) 0x91, (byte) 0x73, (byte) 0x8e, (byte) 0x65, (byte) 0x1d, (byte) 0x48, (byte) 0xf7, + (byte) 0x20, (byte) 0x11, (byte) 0xfc, (byte) 0xea, (byte) 0x31, (byte) 0xd1, (byte) 0x59, (byte) 0x55, + (byte) 0x36, (byte) 0x69, (byte) 0x20, (byte) 0x73, (byte) 0x62, (byte) 0x75, (byte) 0x9c, (byte) 0x74, + (byte) 0x1d, (byte) 0x2f, (byte) 0xa5, (byte) 0xfd, (byte) 0xb7, (byte) 0xf6, (byte) 0x52, (byte) 0x7b, + (byte) 0xd3, (byte) 0x52, (byte) 0xde, (byte) 0x52, (byte) 0x2b, (byte) 0x97, (byte) 0xab, (byte) 0x6, + (byte) 0x44, (byte) 0x95, (byte) 0x5a, (byte) 0x34, (byte) 0xce, (byte) 0x3e, (byte) 0x5a, (byte) 0x82, + (byte) 0xa0, (byte) 0x9f, (byte) 0xe, (byte) 0xfd, (byte) 0x7d, (byte) 0x87, (byte) 0xe7, (byte) 0x4c, + (byte) 0xc, (byte) 0xf1, (byte) 0x13, (byte) 0xc2, (byte) 0x36, (byte) 0xb8, (byte) 0x59, (byte) 0xdc, + (byte) 0xf8, (byte) 0x23, (byte) 0xdd, (byte) 0x59, (byte) 0x25, (byte) 0x2d, (byte) 0x35, (byte) 0xdd, + (byte) 0xc3, (byte) 0x0, (byte) 0x9e, (byte) 0xa7, (byte) 0x7b, (byte) 0x77, (byte) 0x20, (byte) 0xe9, + (byte) 0xd9, (byte) 0x1, (byte) 0x7e, (byte) 0xed, (byte) 0xcd, (byte) 0xd4, (byte) 0xc5, (byte) 0x16, + (byte) 0xcc, (byte) 0xcb, (byte) 0x60, (byte) 0xca, (byte) 0xe1, (byte) 0xd, (byte) 0x76, (byte) 0x24, + (byte) 0x16, (byte) 0x70, (byte) 0x70, (byte) 0x1, (byte) 0xfd, (byte) 0xd8, (byte) 0xc7, (byte) 0x5f, + (byte) 0x51, (byte) 0x9e, (byte) 0xd8, (byte) 0xd3, (byte) 0xd1, (byte) 0x42, (byte) 0x1, (byte) 0x11, + (byte) 0xbe, (byte) 0xf7, (byte) 0x3c, (byte) 0xb9, (byte) 0xfd, (byte) 0xd5, (byte) 0x9e, (byte) 0xd, + (byte) 0x1d, (byte) 0x4c, (byte) 0x14, (byte) 0xe7, (byte) 0x10, (byte) 0xa0, (byte) 0x94, (byte) 0x59, + (byte) 0xb7, (byte) 0xce, (byte) 0xc7, (byte) 0xed, (byte) 0xa6, (byte) 0xfa, (byte) 0xfa, (byte) 0x5c, + (byte) 0x6b, (byte) 0xe9, (byte) 0xd4, (byte) 0x9b, (byte) 0x2b, (byte) 0xe3, (byte) 0x82, (byte) 0x23, + (byte) 0x9a, (byte) 0xaf, (byte) 0xc, (byte) 0xd1, (byte) 0xa9, (byte) 0x6a, (byte) 0x8c, (byte) 0xd4, + (byte) 0x6c, (byte) 0x57, (byte) 0x4f, (byte) 0x97, (byte) 0x24, (byte) 0x32, (byte) 0xb2, (byte) 0x3f, + (byte) 0xd5, (byte) 0xdc, (byte) 0xb0, (byte) 0x64, (byte) 0x24, (byte) 0x15, (byte) 0x24, (byte) 0x92, + (byte) 0xe, (byte) 0x7f, (byte) 0x81, (byte) 0xa3, (byte) 0x8a, (byte) 0x48, (byte) 0xf8, (byte) 0x10, + (byte) 0xb6, (byte) 0x2e, (byte) 0x4b, (byte) 0x3c, (byte) 0xc5, (byte) 0xaa, (byte) 0xce, (byte) 0x21, + (byte) 0x5b, (byte) 0x25, (byte) 0x5b, (byte) 0xbf, (byte) 0x59, (byte) 0xbf, (byte) 0x61, (byte) 0xb0, + (byte) 0x1e, (byte) 0xc0, (byte) 0x4, (byte) 0xbe, (byte) 0x6a, (byte) 0xf9, (byte) 0xce, (byte) 0x35, + (byte) 0xe7, (byte) 0x35, (byte) 0x4b, (byte) 0x50, (byte) 0xe, (byte) 0x3c, (byte) 0xe1, (byte) 0x64, + (byte) 0xdc, (byte) 0xe5, (byte) 0x4b, (byte) 0x35, (byte) 0xf1, (byte) 0x15, (byte) 0xe0, (byte) 0x30, + (byte) 0x5b, (byte) 0xc2, (byte) 0x41, (byte) 0xe0, (byte) 0x1b, (byte) 0xfd, (byte) 0xff, (byte) 0x0, + (byte) 0xc2, (byte) 0xae, (byte) 0xae, (byte) 0x97, (byte) 0x89, (byte) 0xa8, (byte) 0xdd, (byte) 0x5d, + (byte) 0x61, (byte) 0x38, (byte) 0xb3, (byte) 0xa8, (byte) 0x8e, (byte) 0x57, (byte) 0x6a, (byte) 0xcf, + (byte) 0xa7, (byte) 0x6f, (byte) 0xd9, (byte) 0x40, (byte) 0xdf, (byte) 0x68, (byte) 0xdc, (byte) 0xab, + (byte) 0x37, (byte) 0x24, (byte) 0xd4, (byte) 0xa6, (byte) 0x38, (byte) 0xf1, (byte) 0x45, (byte) 0xe7, + (byte) 0x1f, (byte) 0x91, (byte) 0xaa, (byte) 0x39, (byte) 0x29, (byte) 0x65, (byte) 0x6e, (byte) 0xed, + (byte) 0x5a, (byte) 0x15, (byte) 0x1e, (byte) 0x37, (byte) 0x47, (byte) 0x30, (byte) 0xd2, (byte) 0x40, + (byte) 0x3b, (byte) 0x9b, (byte) 0x7d, (byte) 0x53, (byte) 0x3d, (byte) 0xaf, (byte) 0x67, (byte) 0xdd, + (byte) 0xf7, (byte) 0x14, (byte) 0x58, (byte) 0xaa, (byte) 0xd1, (byte) 0x9d, (byte) 0xd5, (byte) 0x49, + (byte) 0xc1, (byte) 0x65, (byte) 0xe5, (byte) 0x51, (byte) 0x9c, (byte) 0x7d, (byte) 0xc7, (byte) 0x3, + (byte) 0xc3, (byte) 0x4d, (byte) 0xb2, (byte) 0x92, (byte) 0x69, (byte) 0x8d, (byte) 0x98, (byte) 0xd2, + (byte) 0xa4, (byte) 0x49, (byte) 0x89, (byte) 0x61, (byte) 0x94, (byte) 0xf, (byte) 0x7d, (byte) 0x44, + (byte) 0x92, (byte) 0x0, (byte) 0xe7, (byte) 0xda, (byte) 0xfa, (byte) 0xdc, (byte) 0x9b, (byte) 0x6d, + (byte) 0xa0, (byte) 0xb9, (byte) 0x56, (byte) 0x47, (byte) 0x5, (byte) 0xf0, (byte) 0x2c, (byte) 0x5b, + (byte) 0x4d, (byte) 0x94, (byte) 0xdc, (byte) 0x37, (byte) 0x7, (byte) 0xf9, (byte) 0x97, (byte) 0x81, + (byte) 0xe6, (byte) 0x54, (byte) 0x89, (byte) 0x8a, (byte) 0xa2, (byte) 0x1f, (byte) 0x33, (byte) 0x8c, + (byte) 0x73, (byte) 0x1f, (byte) 0x7e, (byte) 0x9d, (byte) 0x4f, (byte) 0x7d, (byte) 0x5f, (byte) 0xd1, + (byte) 0x61, (byte) 0xdc, (byte) 0x1b, (byte) 0x3e, (byte) 0x53, (byte) 0x72, (byte) 0x36, (byte) 0x1c, + (byte) 0xbf, (byte) 0x9f, (byte) 0xe, (byte) 0xeb, (byte) 0x3a, (byte) 0xc7, (byte) 0xf1, (byte) 0xf8, + (byte) 0xab, (byte) 0x9e, (byte) 0xf6, (byte) 0xd1, (byte) 0x47, (byte) 0x90, (byte) 0x3b, (byte) 0xcc, + (byte) 0xed, (byte) 0x8b, (byte) 0xfb, (byte) 0x81, (byte) 0xa5, (byte) 0xbb, (byte) 0xdc, (byte) 0xf6, + (byte) 0xd4, (byte) 0x2b, (byte) 0x1e, (byte) 0x26, (byte) 0xe6, (byte) 0x41, (byte) 0x9e, (byte) 0xfa, + (byte) 0xb8, (byte) 0xe, (byte) 0xb8, (byte) 0x41, (byte) 0xce, (byte) 0x65, (byte) 0x8a, (byte) 0x5, + (byte) 0xea, (byte) 0x83, (byte) 0xe1, (byte) 0xa7, (byte) 0x4b, (byte) 0x41, (byte) 0x56, (byte) 0x65, + (byte) 0x2d, (byte) 0xbb, (byte) 0xb7, (byte) 0x7, (byte) 0x90, (byte) 0x12, (byte) 0x3c, (byte) 0x34, + (byte) 0xc3, (byte) 0xa3, (byte) 0xd5, (byte) 0x26, (byte) 0xeb, (byte) 0x4c, (byte) 0x5b, (byte) 0x6c, + (byte) 0x68, (byte) 0x73, (byte) 0xca, (byte) 0x33, (byte) 0xa4, (byte) 0xf0, (byte) 0xc0, (byte) 0x49, + (byte) 0x25, (byte) 0x1f, (byte) 0x14, (byte) 0x41, (byte) 0x40, (byte) 0xd7, (byte) 0x53, (byte) 0x64, + (byte) 0x22, (byte) 0x54, (byte) 0x79, (byte) 0x69, (byte) 0x4, (byte) 0xaf, (byte) 0x6, (byte) 0xa2, + (byte) 0xe2, (byte) 0xfa, (byte) 0x53, (byte) 0xd7, (byte) 0x5d, (byte) 0x1a, (byte) 0x4, (byte) 0xd3, + (byte) 0x85, (byte) 0xca, (byte) 0xff, (byte) 0xd9, (byte) 0x50, (byte) 0x4b, (byte) 0x1, (byte) 0x2, + (byte) 0xa, (byte) 0x0, (byte) 0xa, (byte) 0x0, (byte) 0x0, (byte) 0x8, (byte) 0x0, (byte) 0x0, + (byte) 0x37, (byte) 0xa4, (byte) 0x5c, (byte) 0x38, (byte) 0x52, (byte) 0x69, (byte) 0x4c, (byte) 0x69, + (byte) 0x24, (byte) 0x6, (byte) 0x0, (byte) 0x0, (byte) 0x24, (byte) 0x6, (byte) 0x0, (byte) 0x0, + (byte) 0x1b, (byte) 0x0, (byte) 0x7, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x72, (byte) 0x65, (byte) 0x73, (byte) 0x2f, (byte) 0x64, (byte) 0x72, + (byte) 0x61, (byte) 0x77, (byte) 0x61, (byte) 0x62, (byte) 0x6c, (byte) 0x65, (byte) 0x2f, (byte) 0x73, + (byte) 0x69, (byte) 0x7a, (byte) 0x65, (byte) 0x5f, (byte) 0x34, (byte) 0x38, (byte) 0x78, (byte) 0x34, + (byte) 0x38, (byte) 0x2e, (byte) 0x6a, (byte) 0x70, (byte) 0x67, (byte) 0xfe, (byte) 0xca, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x50, (byte) 0x4b, (byte) 0x5, (byte) 0x6, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x1, (byte) 0x0, + (byte) 0x50, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x64, (byte) 0x6, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, + }; + + /* + * Jar file created by Apache Commons-Compress which creates + * a CEN entry with a Zip64 extra header entry with a size of 0 + * ----------------#1-------------------- + * [Central Directory Header] + * 0x52b: Signature : 0x02014b50 + * 0x52f: Created Zip Spec : 0x2d [4.5] + * 0x530: Created OS : 0x3 [UNIX] + * 0x531: VerMadeby : 0x32d [3, 4.5] + * 0x532: VerExtract : 0x2d [4.5] + * 0x533: Flag : 0x800 + * 0x535: Method : 0x0 [STORED] + * 0x537: Last Mod Time : 0x570169c0 [Tue Aug 01 13:14:00 EDT 2023] + * 0x53b: CRC : 0x0 + * 0x53f: Compressed Size : 0x0 + * 0x543: Uncompressed Size: 0x0 + * 0x547: Name Length : 0x9 + * 0x549: Extra Length : 0x8 + * [tag=0x0001, sz=0, data= ] + * ->ZIP64: + * [tag=0xcafe, sz=0, data= ] + * ->[tag=cafe, size=0] + * 0x54b: Comment Length : 0x0 + * 0x54d: Disk Start : 0x0 + * 0x54f: Attrs : 0x0 + * 0x551: AttrsEx : 0x41ed0010 + * 0x555: Loc Header Offset: 0x0 + * 0x559: File Name : META-INF/ + */ + public static byte[] COMMONS_COMPRESS_JAR = { + (byte) 0x50, (byte) 0x4b, (byte) 0x3, (byte) 0x4, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x8, + (byte) 0x0, (byte) 0x0, (byte) 0xc0, (byte) 0x69, (byte) 0x1, (byte) 0x57, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0x9, (byte) 0x0, (byte) 0x18, (byte) 0x0, (byte) 0x4d, (byte) 0x45, + (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, (byte) 0x2f, (byte) 0x1, + (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xfe, (byte) 0xca, (byte) 0x0, (byte) 0x0, (byte) 0x50, + (byte) 0x4b, (byte) 0x3, (byte) 0x4, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x8, (byte) 0x8, + (byte) 0x0, (byte) 0xbd, (byte) 0x69, (byte) 0x1, (byte) 0x57, (byte) 0x71, (byte) 0xa7, (byte) 0x16, + (byte) 0x53, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0x14, (byte) 0x0, (byte) 0x14, (byte) 0x0, (byte) 0x4d, (byte) 0x45, (byte) 0x54, + (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, (byte) 0x2f, (byte) 0x4d, (byte) 0x41, + (byte) 0x4e, (byte) 0x49, (byte) 0x46, (byte) 0x45, (byte) 0x53, (byte) 0x54, (byte) 0x2e, (byte) 0x4d, + (byte) 0x46, (byte) 0x1, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x68, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x5b, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xf3, (byte) 0x4d, (byte) 0xcc, + (byte) 0xcb, (byte) 0x4c, (byte) 0x4b, (byte) 0x2d, (byte) 0x2e, (byte) 0xd1, (byte) 0xd, (byte) 0x4b, + (byte) 0x2d, (byte) 0x2a, (byte) 0xce, (byte) 0xcc, (byte) 0xcf, (byte) 0xb3, (byte) 0x52, (byte) 0x30, + (byte) 0xd4, (byte) 0x33, (byte) 0xe0, (byte) 0xe5, (byte) 0x72, (byte) 0xcc, (byte) 0x43, (byte) 0x12, + (byte) 0x71, (byte) 0x2c, (byte) 0x48, (byte) 0x4c, (byte) 0xce, (byte) 0x48, (byte) 0x55, (byte) 0x0, + (byte) 0x8a, (byte) 0x1, (byte) 0x25, (byte) 0xd, (byte) 0xd, (byte) 0xf4, (byte) 0x2c, (byte) 0x78, + (byte) 0xb9, (byte) 0x9c, (byte) 0x8b, (byte) 0x52, (byte) 0x13, (byte) 0x4b, (byte) 0x52, (byte) 0x53, + (byte) 0x74, (byte) 0x9d, (byte) 0x2a, (byte) 0x81, (byte) 0x1a, (byte) 0x2c, (byte) 0xf4, (byte) 0xc, + (byte) 0xf4, (byte) 0x80, (byte) 0x12, (byte) 0xda, (byte) 0x46, (byte) 0xba, (byte) 0x66, (byte) 0xa, + (byte) 0x1a, (byte) 0xfe, (byte) 0x45, (byte) 0x89, (byte) 0xc9, (byte) 0x39, (byte) 0xa9, (byte) 0xa, + (byte) 0xce, (byte) 0xf9, (byte) 0x45, (byte) 0x5, (byte) 0xf9, (byte) 0x45, (byte) 0x89, (byte) 0x25, + (byte) 0x40, (byte) 0x3, (byte) 0x34, (byte) 0x79, (byte) 0xb9, (byte) 0x78, (byte) 0xb9, (byte) 0x0, + (byte) 0x50, (byte) 0x4b, (byte) 0x3, (byte) 0x4, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x8, + (byte) 0x8, (byte) 0x0, (byte) 0x61, (byte) 0x69, (byte) 0x1, (byte) 0x57, (byte) 0x16, (byte) 0x64, + (byte) 0x9c, (byte) 0xc5, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0x19, (byte) 0x0, (byte) 0x14, (byte) 0x0, (byte) 0x5a, (byte) 0x69, + (byte) 0x70, (byte) 0x46, (byte) 0x69, (byte) 0x6c, (byte) 0x65, (byte) 0x50, (byte) 0x72, (byte) 0x6f, + (byte) 0x70, (byte) 0x65, (byte) 0x72, (byte) 0x74, (byte) 0x79, (byte) 0x54, (byte) 0x65, (byte) 0x73, + (byte) 0x74, (byte) 0x2e, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x1, + (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0xf, (byte) 0x7, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x4, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x85, (byte) 0x55, (byte) 0xcf, (byte) 0x53, (byte) 0xdb, + (byte) 0x46, (byte) 0x14, (byte) 0xfe, (byte) 0xd6, (byte) 0x3f, (byte) 0x90, (byte) 0x2d, (byte) 0x8b, + (byte) 0x38, (byte) 0x36, (byte) 0x21, (byte) 0xc1, (byte) 0x34, (byte) 0x4, (byte) 0x12, (byte) 0x70, + (byte) 0x63, (byte) 0xb0, (byte) 0x8d, (byte) 0xdb, (byte) 0x42, (byte) 0xd3, (byte) 0x36, (byte) 0xa6, + (byte) 0xf9, (byte) 0x45, (byte) 0x42, (byte) 0xb, (byte) 0x35, (byte) 0xe0, (byte) 0x62, (byte) 0x87, + (byte) 0xd4, (byte) 0xa4, (byte) 0x6d, (byte) 0x22, (byte) 0xdb, (byte) 0x4a, (byte) 0x22, (byte) 0x2a, + (byte) 0x4b, (byte) 0x1a, (byte) 0x49, (byte) 0x2e, (byte) 0x49, (byte) 0x67, (byte) 0x7a, (byte) 0xe8, + (byte) 0x4c, (byte) 0xcf, (byte) 0x9d, (byte) 0x69, (byte) 0xfe, (byte) 0x82, (byte) 0xde, (byte) 0x38, + (byte) 0xf5, (byte) 0x40, (byte) 0xe, (byte) 0x86, (byte) 0x94, (byte) 0x49, (byte) 0x73, (byte) 0xcb, + (byte) 0x21, (byte) 0xff, (byte) 0x51, (byte) 0x2f, (byte) 0xa5, (byte) 0x6f, (byte) 0x25, (byte) 0xc0, + (byte) 0x86, (byte) 0x98, (byte) 0x29, (byte) 0xcc, (byte) 0x68, (byte) 0x77, (byte) 0xdf, (byte) 0xee, + (byte) 0xf7, (byte) 0xbd, (byte) 0xf7, (byte) 0xbe, (byte) 0xf7, (byte) 0x76, (byte) 0xfd, (byte) 0xf6, + (byte) 0xdf, (byte) 0xbf, (byte) 0xfe, (byte) 0x6, (byte) 0x70, (byte) 0xb, (byte) 0xf, (byte) 0x45, + (byte) 0xf8, (byte) 0xe0, (byte) 0x17, (byte) 0x10, (byte) 0x90, (byte) 0x10, (byte) 0x44, (byte) 0xf, + (byte) 0xc3, (byte) 0xe9, (byte) 0x75, (byte) 0xf9, (byte) 0x47, (byte) 0x39, (byte) 0xa7, (byte) 0xc9, + (byte) 0xfa, (byte) 0xe3, (byte) 0xdc, (byte) 0x72, (byte) 0x75, (byte) 0x5d, (byte) 0xa9, (byte) 0x39, + (byte) 0xc, (byte) 0x3d, (byte) 0x33, (byte) 0xaa, (byte) 0xae, (byte) 0x3a, (byte) 0xd7, (byte) 0x18, + (byte) 0xfc, (byte) 0xa9, (byte) 0xf1, (byte) 0x55, (byte) 0x1, (byte) 0x21, (byte) 0x86, (byte) 0xbe, + (byte) 0x35, (byte) 0xd5, (byte) 0x9c, (byte) 0x53, (byte) 0x35, (byte) 0xa5, (byte) 0x68, (byte) 0x19, + (byte) 0xa6, (byte) 0x62, (byte) 0x39, (byte) 0xcf, (byte) 0xca, (byte) 0x8a, (byte) 0xed, (byte) 0x88, + (byte) 0x10, (byte) 0xe0, (byte) 0xe7, (byte) 0x9f, (byte) 0x88, (byte) 0x4, (byte) 0x89, (byte) 0x33, + (byte) 0x9d, (byte) 0xb2, (byte) 0x14, (byte) 0xb9, (byte) 0x5e, (byte) 0x52, (byte) 0xf5, (byte) 0xc7, + (byte) 0x9a, (byte) 0xc2, (byte) 0xcf, (byte) 0xa, (byte) 0x38, (byte) 0xc5, (byte) 0xd0, (byte) 0xef, + (byte) 0xb2, (byte) 0x37, (byte) 0x1d, (byte) 0x55, (byte) 0xcb, (byte) 0xfd, (byte) 0xa4, (byte) 0x9a, + (byte) 0xb9, (byte) 0x7d, (byte) 0x9a, (byte) 0x10, (byte) 0x4e, (byte) 0x33, (byte) 0x64, (byte) 0x72, + (byte) 0x77, (byte) 0x6d, (byte) 0xc5, (byte) 0xb2, (byte) 0x73, (byte) 0xda, (byte) 0xba, (byte) 0xac, + (byte) 0xd7, (byte) 0xf9, (byte) 0xe4, (byte) 0xb6, (byte) 0xb1, (byte) 0xa1, (byte) 0x6b, (byte) 0x86, + (byte) 0x5c, (byte) 0xb7, (byte) 0x73, (byte) 0x1b, (byte) 0xb5, (byte) 0x29, (byte) 0xab, (byte) 0x6e, + (byte) 0xca, (byte) 0xe4, (byte) 0x48, (byte) 0x53, (byte) 0xab, (byte) 0xf6, (byte) 0xe4, (byte) 0xba, + (byte) 0x6c, (byte) 0x89, (byte) 0xe8, (byte) 0x45, (byte) 0x9c, (byte) 0x47, (byte) 0xdc, (byte) 0x47, + (byte) 0x9c, (byte) 0xa9, (byte) 0x42, (byte) 0x3b, (byte) 0xe6, (byte) 0x92, (byte) 0x63, (byte) 0x91, + (byte) 0xc7, (byte) 0xfc, (byte) 0xf8, (byte) 0x6a, (byte) 0x18, (byte) 0xfd, (byte) 0x38, (byte) 0x2b, + (byte) 0xe0, (byte) 0x9c, (byte) 0x84, (byte) 0x1, (byte) 0x24, (byte) 0x8e, (byte) 0xa4, (byte) 0x55, + (byte) 0x7a, (byte) 0x66, (byte) 0x3b, (byte) 0x4a, (byte) 0x83, (byte) 0xb2, (byte) 0x31, (byte) 0x9a, + (byte) 0x94, (byte) 0x5c, (byte) 0xbf, (byte) 0x7, (byte) 0x56, (byte) 0x8d, (byte) 0x5c, (byte) 0x91, + (byte) 0x90, (byte) 0xe, (byte) 0xe1, (byte) 0x15, (byte) 0xb9, (byte) 0x91, (byte) 0xf, (byte) 0xe1, + (byte) 0x3d, (byte) 0xc2, (byte) 0xf0, (byte) 0xd8, (byte) 0x46, (byte) 0x92, (byte) 0xf6, (byte) 0x8, + (byte) 0x25, (byte) 0xa9, (byte) 0x2b, (byte) 0xf5, (byte) 0xa4, (byte) 0x2e, (byte) 0x62, (byte) 0x8, + (byte) 0x17, (byte) 0x4, (byte) 0xc, (byte) 0x4b, (byte) 0x18, (byte) 0xc1, (byte) 0x45, (byte) 0x52, + (byte) 0xa1, (byte) 0xb, (byte) 0x92, (byte) 0xd4, (byte) 0x32, (byte) 0xf9, (byte) 0xea, (byte) 0x11, + (byte) 0xc3, (byte) 0x4c, (byte) 0x97, (byte) 0xb8, (byte) 0xee, (byte) 0x17, (byte) 0x8e, (byte) 0xcb, + (byte) 0x9b, (byte) 0x1f, (byte) 0xef, (byte) 0x1a, (byte) 0x0, (byte) 0x4f, (byte) 0x70, (byte) 0x54, + (byte) 0xc2, (byte) 0x18, (byte) 0x17, (byte) 0x32, (byte) 0x58, (byte) 0xd3, (byte) 0xc, (byte) 0x9b, + (byte) 0xf4, (byte) 0x7b, (byte) 0xff, (byte) 0xc0, (byte) 0xa5, (byte) 0xb, (byte) 0x2f, (byte) 0x3f, + (byte) 0xb1, (byte) 0x8c, (byte) 0xd, (byte) 0xb9, (byte) 0xaa, (byte) 0x29, (byte) 0x22, (byte) 0x92, + (byte) 0x48, (byte) 0x49, (byte) 0x18, (byte) 0xc7, (byte) 0x4, (byte) 0x43, (byte) 0xaf, (byte) 0x5c, + (byte) 0xaf, (byte) 0x97, (byte) 0x9a, (byte) 0xa6, (byte) 0x69, (byte) 0x29, (byte) 0xb6, (byte) 0xad, + (byte) 0xd4, (byte) 0x19, (byte) 0x6, (byte) 0x3a, (byte) 0x63, (byte) 0x38, (byte) 0x44, (byte) 0xe4, + (byte) 0x79, (byte) 0x19, (byte) 0x33, (byte) 0x1d, (byte) 0x9, (byte) 0xcc, (byte) 0x2f, (byte) 0xdf, + (byte) 0x79, (byte) 0x5a, (byte) 0x53, (byte) 0x4c, (byte) 0x47, (byte) 0x35, (byte) 0x74, (byte) 0x1, + (byte) 0x93, (byte) 0xc, (byte) 0x83, (byte) 0x6d, (byte) 0xd0, (byte) 0x4a, (byte) 0x53, (byte) 0x77, + (byte) 0xd4, (byte) 0x86, (byte) 0x72, (byte) 0xb8, (byte) 0x2f, (byte) 0x22, (byte) 0x8b, (byte) 0xf, + (byte) 0xb8, (byte) 0xf2, (byte) 0x13, (byte) 0x2, (byte) 0x3e, (byte) 0x3a, (byte) 0xaa, (byte) 0xab, + (byte) 0x9b, (byte) 0x62, (byte) 0x4, (byte) 0xd3, (byte) 0xf8, (byte) 0x58, (byte) 0xc0, (byte) 0x15, + (byte) 0x9, (byte) 0x9f, (byte) 0xe0, (byte) 0x53, (byte) 0x86, (byte) 0xb8, (byte) 0xbb, (byte) 0xaf, + (byte) 0x93, (byte) 0x8f, (byte) 0x47, (byte) 0x24, (byte) 0x66, (byte) 0xae, (byte) 0x28, (byte) 0x3b, + (byte) 0x4f, (byte) 0x18, (byte) 0x7c, (byte) 0x6, (byte) 0xc9, (byte) 0x93, (byte) 0xff, (byte) 0x1f, + (byte) 0x79, (byte) 0xe, (byte) 0x2a, (byte) 0x59, (byte) 0x78, (byte) 0x97, (byte) 0x21, (byte) 0x1f, + (byte) 0xc1, (byte) 0x55, (byte) 0xe4, (byte) 0x5, (byte) 0xcc, (byte) 0x70, (byte) 0x27, (byte) 0x9f, + (byte) 0x53, (byte) 0xd6, (byte) 0xed, (byte) 0xae, (byte) 0x5a, (byte) 0x94, (byte) 0x4d, (byte) 0x86, + (byte) 0x58, (byte) 0x6a, (byte) 0x1f, (byte) 0x75, (byte) 0x60, (byte) 0x22, (byte) 0x39, (byte) 0xaf, + (byte) 0xe3, (byte) 0x86, (byte) 0x80, (byte) 0x9b, (byte) 0x12, (byte) 0x75, (byte) 0xfc, (byte) 0x2c, + (byte) 0x43, (byte) 0xe2, (byte) 0x28, (byte) 0x27, (byte) 0xaf, (byte) 0xb3, (byte) 0xd7, (byte) 0x15, + (byte) 0x36, (byte) 0x91, (byte) 0xe9, (byte) 0xca, (byte) 0x46, (byte) 0xdb, (byte) 0xc0, (byte) 0x70, + (byte) 0x3d, (byte) 0xd5, (byte) 0x2d, (byte) 0x82, (byte) 0x63, (byte) 0xfc, (byte) 0xc7, (byte) 0xa3, + (byte) 0x6c, (byte) 0x13, (byte) 0x50, (byte) 0x2b, (byte) 0xdd, (byte) 0x61, (byte) 0x88, (byte) 0x74, + (byte) 0x74, (byte) 0x11, (byte) 0x57, (byte) 0xe8, (byte) 0xb, (byte) 0x9, (byte) 0x5f, (byte) 0x62, + (byte) 0x9e, (byte) 0xee, (byte) 0x88, (byte) 0x63, (byte) 0xdc, (byte) 0xac, (byte) 0xda, (byte) 0x86, + (byte) 0xd6, (byte) 0x74, (byte) 0x14, (byte) 0x4f, (byte) 0x9a, (byte) 0xb3, (byte) 0xa9, (byte) 0x13, + (byte) 0x12, (byte) 0x9e, (byte) 0xc6, (byte) 0x57, (byte) 0x12, (byte) 0xa, (byte) 0x58, (byte) 0x64, + (byte) 0x8, (byte) 0x39, (byte) 0x86, (byte) 0xa7, (byte) 0xd, (byte) 0xc3, (byte) 0x99, (byte) 0x83, + (byte) 0xd3, (byte) 0x9d, (byte) 0x8a, (byte) 0x89, (byte) 0x58, (byte) 0xc6, (byte) 0xa8, (byte) 0x80, + (byte) 0x22, (byte) 0x55, (byte) 0xff, (byte) 0xa4, (byte) 0xa0, (byte) 0x42, (byte) 0x58, (byte) 0xa1, + (byte) 0x22, (byte) 0x27, (byte) 0x75, (byte) 0xfe, (byte) 0x3f, (byte) 0x46, (byte) 0x7f, (byte) 0xbc, + (byte) 0xc9, (byte) 0x97, (byte) 0x96, (byte) 0xcb, (byte) 0x1d, (byte) 0x8d, (byte) 0x9e, (byte) 0x46, + (byte) 0x59, (byte) 0xc2, (byte) 0x5d, (byte) 0xde, (byte) 0x7d, (byte) 0x51, (byte) 0xd3, (byte) 0x6b, + (byte) 0x4b, (byte) 0xb9, (byte) 0xf6, (byte) 0x43, (byte) 0xd9, (byte) 0x92, (byte) 0x6b, (byte) 0xa, + (byte) 0x5, (byte) 0xb0, (byte) 0x36, (byte) 0x5f, (byte) 0x7c, (byte) 0x30, (byte) 0x37, (byte) 0x5f, + (byte) 0xa0, (byte) 0xbc, (byte) 0xe2, (byte) 0xef, (byte) 0xba, (byte) 0x27, (byte) 0x5, (byte) 0x67, + (byte) 0xd, (byte) 0xdd, (byte) 0x76, (byte) 0x64, (byte) 0xdd, (byte) 0x59, (byte) 0x95, (byte) 0xb5, + (byte) 0x26, (byte) 0x9d, (byte) 0xf, (byte) 0xcc, (byte) 0x1a, (byte) 0x75, (byte) 0x1a, (byte) 0xa2, + (byte) 0x5, (byte) 0x55, (byte) 0x57, (byte) 0x96, (byte) 0x9a, (byte) 0x8d, (byte) 0xaa, (byte) 0x62, + (byte) 0x95, (byte) 0x79, (byte) 0x17, (byte) 0xd2, (byte) 0x46, (byte) 0x43, (byte) 0x56, (byte) 0x75, + (byte) 0x9e, (byte) 0x73, (byte) 0xb7, (byte) 0xba, (byte) 0xaf, (byte) 0x12, (byte) 0x91, (byte) 0xeb, + (byte) 0x95, (byte) 0xf4, (byte) 0xdd, (byte) 0x3f, (byte) 0x2f, (byte) 0x96, (byte) 0x8c, (byte) 0xa6, + (byte) 0x55, (byte) 0x73, (byte) 0x5f, (byte) 0x13, (byte) 0x4a, (byte) 0xae, (byte) 0xcb, (byte) 0x1b, + (byte) 0x34, (byte) 0xc9, (byte) 0x69, (byte) 0x70, (byte) 0x91, (byte) 0x1e, (byte) 0x21, (byte) 0x1f, + (byte) 0x3d, (byte) 0x6e, (byte) 0x54, (byte) 0x67, (byte) 0xac, (byte) 0xe2, (byte) 0x1e, (byte) 0x8d, + (byte) 0xdf, (byte) 0xd0, (byte) 0xca, (byte) 0x87, (byte) 0x28, (byte) 0xfc, (byte) 0x34, (byte) 0xa7, + (byte) 0x57, (byte) 0x8e, (byte) 0xbe, (byte) 0x15, (byte) 0xb2, (byte) 0xc, (byte) 0xd1, (byte) 0xc8, + (byte) 0x68, (byte) 0xc, (byte) 0x4e, (byte) 0x6c, (byte) 0x83, (byte) 0x6d, (byte) 0xb9, (byte) 0x80, + (byte) 0x35, (byte) 0xfa, (byte) 0xf6, (byte) 0xb8, (byte) 0xc6, (byte) 0x10, (byte) 0xc2, (byte) 0xb8, + (byte) 0x8f, (byte) 0x6f, (byte) 0xf7, (byte) 0x8f, (byte) 0x5e, (byte) 0x26, (byte) 0x38, (byte) 0xb7, + (byte) 0x46, (byte) 0x76, (byte) 0x21, (byte) 0x54, (byte) 0xb6, (byte) 0x11, (byte) 0x6e, (byte) 0x41, + (byte) 0x6c, (byte) 0x3, (byte) 0x44, (byte) 0xd7, (byte) 0x9b, (byte) 0x4, (byte) 0x7e, (byte) 0x67, + (byte) 0x7d, (byte) 0xfc, (byte) 0xed, (byte) 0xf3, (byte) 0x40, (byte) 0xec, (byte) 0xf, (byte) 0x9a, + (byte) 0x5, (byte) 0x69, (byte) 0xe7, (byte) 0xc5, (byte) 0x2e, (byte) 0x7a, (byte) 0x2b, (byte) 0xf1, + (byte) 0xe8, (byte) 0x36, (byte) 0x62, (byte) 0x85, (byte) 0x17, (byte) 0x38, (byte) 0x13, (byte) 0x1f, + (byte) 0xc, (byte) 0xbc, (byte) 0x82, (byte) 0xaf, (byte) 0xe2, (byte) 0x8f, (byte) 0x47, (byte) 0x4b, + (byte) 0x2d, (byte) 0x9c, (byte) 0xbf, (byte) 0x97, (byte) 0x6e, (byte) 0xe1, (byte) 0xd2, (byte) 0x26, + (byte) 0xfa, (byte) 0x16, (byte) 0xbd, (byte) 0x31, (byte) 0xbc, (byte) 0x94, (byte) 0xc9, (byte) 0xb6, + (byte) 0x70, (byte) 0x39, (byte) 0xf3, (byte) 0x7a, (byte) 0x13, (byte) 0xbd, (byte) 0x85, (byte) 0x5d, + (byte) 0x64, (byte) 0x2b, (byte) 0xe9, (byte) 0x6d, (byte) 0xe4, (byte) 0x5e, (byte) 0xc7, (byte) 0xa3, + (byte) 0xfe, (byte) 0x57, (byte) 0xf8, (byte) 0x70, (byte) 0x7, (byte) 0x53, (byte) 0x85, (byte) 0xf4, + (byte) 0xe, (byte) 0x3e, (byte) 0xdb, (byte) 0xc1, (byte) 0xb5, (byte) 0x45, (byte) 0xce, (byte) 0x73, + (byte) 0xdb, (byte) 0xe3, (byte) 0x49, (byte) 0xbf, (byte) 0xc4, (byte) 0x1c, (byte) 0xc3, (byte) 0x4b, + (byte) 0x2c, (byte) 0x30, (byte) 0xb8, (byte) 0x84, (byte) 0x99, (byte) 0x37, (byte) 0x18, (byte) 0xc9, + (byte) 0xb4, (byte) 0xb0, (byte) 0xb4, (byte) 0x89, (byte) 0xc4, (byte) 0x12, (byte) 0xcd, (byte) 0xe3, + (byte) 0xde, (byte) 0x3c, (byte) 0x72, (byte) 0x35, (byte) 0x90, (byte) 0x4d, (byte) 0x4, (byte) 0x88, + (byte) 0x3a, (byte) 0x4b, (byte) 0xd4, (byte) 0xa3, (byte) 0x2e, (byte) 0xfe, (byte) 0xeb, (byte) 0x13, + (byte) 0xf0, (byte) 0x2d, (byte) 0x94, (byte) 0xb6, (byte) 0x28, (byte) 0x72, (byte) 0x11, (byte) 0xe7, + (byte) 0x31, (byte) 0x4a, (byte) 0x4f, (byte) 0xcb, (byte) 0x18, (byte) 0x52, (byte) 0xd4, (byte) 0xd, + (byte) 0x49, (byte) 0xca, (byte) 0x63, (byte) 0xa, (byte) 0x57, (byte) 0x68, (byte) 0xb6, (byte) 0x82, + (byte) 0x6, (byte) 0x9e, (byte) 0xd2, (byte) 0xfa, (byte) 0x67, (byte) 0xfc, (byte) 0x82, (byte) 0x5f, + (byte) 0x69, (byte) 0x5c, (byte) 0xc0, (byte) 0x6f, (byte) 0xf8, (byte) 0x9d, (byte) 0xec, (byte) 0x3e, + (byte) 0x57, (byte) 0x8b, (byte) 0x39, (byte) 0xc4, (byte) 0xe8, (byte) 0x1b, (byte) 0x23, (byte) 0xf4, + (byte) 0x39, (byte) 0xc2, (byte) 0xf, (byte) 0x10, (byte) 0x43, (byte) 0x8c, (byte) 0x70, (byte) 0x83, + (byte) 0x84, (byte) 0x1c, (byte) 0xa0, (byte) 0xbb, (byte) 0x9a, (byte) 0xc0, (byte) 0xd, (byte) 0xb2, + (byte) 0x2e, (byte) 0x90, (byte) 0xf2, (byte) 0x2b, (byte) 0xb8, (byte) 0x40, (byte) 0x3c, (byte) 0xc3, + (byte) 0xc4, (byte) 0x34, (byte) 0x44, (byte) 0xf8, (byte) 0x4b, (byte) 0xc4, (byte) 0x30, (byte) 0x8c, + (byte) 0xe7, (byte) 0xf4, (byte) 0xac, (byte) 0xfe, (byte) 0x49, (byte) 0xd5, (byte) 0xdb, (byte) 0x22, + (byte) 0xd4, (byte) 0x77, (byte) 0xc4, (byte) 0xf2, (byte) 0x10, (byte) 0xd2, (byte) 0x1e, (byte) 0x4d, + (byte) 0x7d, (byte) 0x2, (byte) 0x4, (byte) 0x81, (byte) 0xa4, (byte) 0x65, (byte) 0x2, (byte) 0x92, + (byte) 0x7b, (byte) 0xfc, (byte) 0x47, (byte) 0xc6, (byte) 0x5b, (byte) 0xd3, (byte) 0xca, (byte) 0x35, + (byte) 0x5, (byte) 0xff, (byte) 0x1, (byte) 0xbb, (byte) 0x25, (byte) 0x20, (byte) 0x1d, (byte) 0xde, + (byte) 0x23, (byte) 0x7, (byte) 0xde, (byte) 0xde, (byte) 0xb4, (byte) 0x40, (byte) 0x57, (byte) 0xc0, + (byte) 0x3b, (byte) 0x1e, (byte) 0x41, (byte) 0xe0, (byte) 0xd0, (byte) 0x74, (byte) 0x80, (byte) 0x10, + (byte) 0xf6, (byte) 0x11, (byte) 0xc3, (byte) 0x54, (byte) 0xa7, (byte) 0xef, (byte) 0xdd, (byte) 0xce, + (byte) 0x78, (byte) 0xf0, (byte) 0x1f, (byte) 0x50, (byte) 0x4b, (byte) 0x1, (byte) 0x2, (byte) 0x2d, + (byte) 0x3, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x8, (byte) 0x0, (byte) 0x0, (byte) 0xc0, + (byte) 0x69, (byte) 0x1, (byte) 0x57, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x9, + (byte) 0x0, (byte) 0x8, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0xed, (byte) 0x41, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x4d, (byte) 0x45, (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, + (byte) 0x46, (byte) 0x2f, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xfe, (byte) 0xca, + (byte) 0x0, (byte) 0x0, (byte) 0x50, (byte) 0x4b, (byte) 0x1, (byte) 0x2, (byte) 0x2d, (byte) 0x3, + (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x8, (byte) 0x8, (byte) 0x0, (byte) 0xbd, (byte) 0x69, + (byte) 0x1, (byte) 0x57, (byte) 0x71, (byte) 0xa7, (byte) 0x16, (byte) 0x53, (byte) 0x5b, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x68, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x14, (byte) 0x0, + (byte) 0x4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0xa4, (byte) 0x81, (byte) 0x3f, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x4d, (byte) 0x45, (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, + (byte) 0x2f, (byte) 0x4d, (byte) 0x41, (byte) 0x4e, (byte) 0x49, (byte) 0x46, (byte) 0x45, (byte) 0x53, + (byte) 0x54, (byte) 0x2e, (byte) 0x4d, (byte) 0x46, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x50, (byte) 0x4b, (byte) 0x1, (byte) 0x2, (byte) 0x2d, (byte) 0x3, (byte) 0x2d, (byte) 0x0, + (byte) 0x0, (byte) 0x8, (byte) 0x8, (byte) 0x0, (byte) 0x61, (byte) 0x69, (byte) 0x1, (byte) 0x57, + (byte) 0x16, (byte) 0x64, (byte) 0x9c, (byte) 0xc5, (byte) 0x0, (byte) 0x4, (byte) 0x0, (byte) 0x0, + (byte) 0xf, (byte) 0x7, (byte) 0x0, (byte) 0x0, (byte) 0x19, (byte) 0x0, (byte) 0x4, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0xa4, (byte) 0x81, (byte) 0xe0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x5a, (byte) 0x69, + (byte) 0x70, (byte) 0x46, (byte) 0x69, (byte) 0x6c, (byte) 0x65, (byte) 0x50, (byte) 0x72, (byte) 0x6f, + (byte) 0x70, (byte) 0x65, (byte) 0x72, (byte) 0x74, (byte) 0x79, (byte) 0x54, (byte) 0x65, (byte) 0x73, + (byte) 0x74, (byte) 0x2e, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x1, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x50, (byte) 0x4b, (byte) 0x6, (byte) 0x6, (byte) 0x2c, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2d, + (byte) 0x0, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xd0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2b, (byte) 0x5, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x50, (byte) 0x4b, (byte) 0x6, (byte) 0x7, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xfb, (byte) 0x5, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x50, + (byte) 0x4b, (byte) 0x5, (byte) 0x6, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, + (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0xd0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2b, + (byte) 0x5, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + }; + + /* + * Jar file created by Ant specifying zip64mode="always" and createUnicodeExtraFields="always" + * ----------------#1-------------------- + * [Central Directory Header] + * 0x51b: Signature : 0x02014b50 + * 0x51f: Created Zip Spec : 0x2d [4.5] + * 0x520: Created OS : 0x3 [UNIX] + * 0x521: VerMadeby : 0x32d [3, 4.5] + * 0x522: VerExtract : 0x2d [4.5] + * 0x523: Flag : 0x800 + * 0x525: Method : 0x8 [DEFLATED] + * 0x527: Last Mod Time : 0x570b3767 [Fri Aug 11 06:59:14 EDT 2023] + * 0x52b: CRC : 0x5e4fa53f + * 0x52f: Compressed Size : 0xffffffff + * 0x533: Uncompressed Size: 0xffffffff + * 0x537: Name Length : 0x10 + * 0x539: Extra Length : 0x35 + * Extra data:[01, 00, 18, 00, 87, 04, 00, 00, 00, 00, 00, 00, c7, 02, 00, 00, 00, 00, 00, 00, 15, 01, 00, 00, 00, 00, 00, 00, 75, 70, 15, 00, 01, 94, 82, 60, 61, 52, 65, 61, 64, 41, 6e, 74, 4a, 61, 72, 2e, 63, 6c, 61, 73, 73] + * [tag=0x0001, sz=24] + * ->ZIP64: size *0x487 csize *0x2c7 LOC Off *0x115 + * [data= 87 04 00 00 00 00 00 00 c7 02 00 00 00 00 00 00 15 01 00 00 00 00 00 00 ] + * [tag=0x7075, sz=21] + * ->[Unknown tag] + * [data= 01 94 82 60 61 52 65 61 64 41 6e 74 4a 61 72 2e 63 6c 61 73 73 ] + * 0x53b: Comment Length : 0x0 + * 0x53d: Disk Start : 0x0 + * 0x53f: Attrs : 0x0 + * 0x541: AttrsEx : 0x81a40000 + * 0x545: Loc Header Offset: 0xffffffff + * 0x549: File Name : ReadAntJar.class + */ + public static byte[] ANT_ZIP64_UNICODE_EXTRA_JAR = { + + (byte) 0x50, (byte) 0x4b, (byte) 0x3, (byte) 0x4, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x8, + (byte) 0x0, (byte) 0x0, (byte) 0x18, (byte) 0x7e, (byte) 0xe, (byte) 0x57, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0x9, (byte) 0x0, (byte) 0x2a, (byte) 0x0, (byte) 0x4d, (byte) 0x45, + (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, (byte) 0x2f, (byte) 0x1, + (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xfe, (byte) 0xca, (byte) 0x0, (byte) 0x0, (byte) 0x75, + (byte) 0x70, (byte) 0xe, (byte) 0x0, (byte) 0x1, (byte) 0x8, (byte) 0xa1, (byte) 0x8c, (byte) 0x13, + (byte) 0x4d, (byte) 0x45, (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, + (byte) 0x2f, (byte) 0x50, (byte) 0x4b, (byte) 0x3, (byte) 0x4, (byte) 0x2d, (byte) 0x0, (byte) 0x0, + (byte) 0x8, (byte) 0x8, (byte) 0x0, (byte) 0x17, (byte) 0x7e, (byte) 0xe, (byte) 0x57, (byte) 0x31, + (byte) 0x59, (byte) 0x76, (byte) 0x4d, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x14, (byte) 0x0, (byte) 0x31, (byte) 0x0, (byte) 0x4d, + (byte) 0x45, (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, (byte) 0x2f, + (byte) 0x4d, (byte) 0x41, (byte) 0x4e, (byte) 0x49, (byte) 0x46, (byte) 0x45, (byte) 0x53, (byte) 0x54, + (byte) 0x2e, (byte) 0x4d, (byte) 0x46, (byte) 0x1, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x6e, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x61, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x75, + (byte) 0x70, (byte) 0x19, (byte) 0x0, (byte) 0x1, (byte) 0x85, (byte) 0x85, (byte) 0x84, (byte) 0x2, + (byte) 0x4d, (byte) 0x45, (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, + (byte) 0x2f, (byte) 0x4d, (byte) 0x41, (byte) 0x4e, (byte) 0x49, (byte) 0x46, (byte) 0x45, (byte) 0x53, + (byte) 0x54, (byte) 0x2e, (byte) 0x4d, (byte) 0x46, (byte) 0xf3, (byte) 0x4d, (byte) 0xcc, (byte) 0xcb, + (byte) 0x4c, (byte) 0x4b, (byte) 0x2d, (byte) 0x2e, (byte) 0xd1, (byte) 0xd, (byte) 0x4b, (byte) 0x2d, + (byte) 0x2a, (byte) 0xce, (byte) 0xcc, (byte) 0xcf, (byte) 0xb3, (byte) 0x52, (byte) 0x30, (byte) 0xd4, + (byte) 0x33, (byte) 0xe0, (byte) 0xe5, (byte) 0x72, (byte) 0xcc, (byte) 0x43, (byte) 0x12, (byte) 0x71, + (byte) 0x2c, (byte) 0x48, (byte) 0x4c, (byte) 0xce, (byte) 0x48, (byte) 0x55, (byte) 0x0, (byte) 0x8a, + (byte) 0x1, (byte) 0x25, (byte) 0xd, (byte) 0xd, (byte) 0xf4, (byte) 0xc, (byte) 0x4d, (byte) 0x12, + (byte) 0x73, (byte) 0xa, (byte) 0x32, (byte) 0x12, (byte) 0x79, (byte) 0xb9, (byte) 0x9c, (byte) 0x8b, + (byte) 0x52, (byte) 0x13, (byte) 0x4b, (byte) 0x52, (byte) 0x53, (byte) 0x74, (byte) 0x9d, (byte) 0x2a, + (byte) 0x81, (byte) 0xda, (byte) 0x2c, (byte) 0xf4, (byte) 0x80, (byte) 0x32, (byte) 0x7a, (byte) 0x86, + (byte) 0xda, (byte) 0x46, (byte) 0xba, (byte) 0x66, (byte) 0xa, (byte) 0x1a, (byte) 0xfe, (byte) 0x45, + (byte) 0x89, (byte) 0xc9, (byte) 0x39, (byte) 0xa9, (byte) 0xa, (byte) 0xce, (byte) 0xf9, (byte) 0x45, + (byte) 0x5, (byte) 0xf9, (byte) 0x45, (byte) 0x89, (byte) 0x25, (byte) 0x40, (byte) 0x63, (byte) 0x34, + (byte) 0x79, (byte) 0xb9, (byte) 0x78, (byte) 0xb9, (byte) 0x0, (byte) 0x50, (byte) 0x4b, (byte) 0x3, + (byte) 0x4, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x8, (byte) 0x8, (byte) 0x0, (byte) 0x67, + (byte) 0x37, (byte) 0xb, (byte) 0x57, (byte) 0x3f, (byte) 0xa5, (byte) 0x4f, (byte) 0x5e, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x10, + (byte) 0x0, (byte) 0x2d, (byte) 0x0, (byte) 0x52, (byte) 0x65, (byte) 0x61, (byte) 0x64, (byte) 0x41, + (byte) 0x6e, (byte) 0x74, (byte) 0x4a, (byte) 0x61, (byte) 0x72, (byte) 0x2e, (byte) 0x63, (byte) 0x6c, + (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x1, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x87, + (byte) 0x4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xc7, + (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x75, + (byte) 0x70, (byte) 0x15, (byte) 0x0, (byte) 0x1, (byte) 0x94, (byte) 0x82, (byte) 0x60, (byte) 0x61, + (byte) 0x52, (byte) 0x65, (byte) 0x61, (byte) 0x64, (byte) 0x41, (byte) 0x6e, (byte) 0x74, (byte) 0x4a, + (byte) 0x61, (byte) 0x72, (byte) 0x2e, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, + (byte) 0x75, (byte) 0x53, (byte) 0x5b, (byte) 0x57, (byte) 0x12, (byte) 0x51, (byte) 0x18, (byte) 0xdd, + (byte) 0x3, (byte) 0xc3, (byte) 0x1c, (byte) 0x18, (byte) 0x47, (byte) 0x41, (byte) 0xcc, (byte) 0xb, + (byte) 0x96, (byte) 0x89, (byte) 0x25, (byte) 0x89, (byte) 0x17, (byte) 0xa0, (byte) 0x8b, (byte) 0x76, + (byte) 0x41, (byte) 0x33, (byte) 0xab, (byte) 0x95, (byte) 0x99, (byte) 0x21, (byte) 0xb4, (byte) 0x84, + (byte) 0x65, (byte) 0x8b, (byte) 0x7a, (byte) 0x1a, (byte) 0x61, (byte) 0xb2, (byte) 0x51, (byte) 0x98, + (byte) 0x99, (byte) 0x35, (byte) 0xc, (byte) 0x76, (byte) 0x79, (byte) 0xea, (byte) 0xa1, (byte) 0x7e, + (byte) 0x8b, (byte) 0xcf, (byte) 0xf6, (byte) 0x80, (byte) 0x6b, (byte) 0xe5, (byte) 0x2a, (byte) 0xdf, + (byte) 0x7c, (byte) 0xe8, (byte) 0x47, (byte) 0x65, (byte) 0xdf, (byte) 0x19, (byte) 0x50, (byte) 0xb0, + (byte) 0x65, (byte) 0x33, (byte) 0x8b, (byte) 0xef, (byte) 0x70, (byte) 0xbe, (byte) 0xb3, (byte) 0xf7, + (byte) 0xfe, (byte) 0x6e, (byte) 0x73, (byte) 0x7e, (byte) 0xff, (byte) 0xf9, (byte) 0xf1, (byte) 0xb, + (byte) 0xc0, (byte) 0x2c, (byte) 0x1e, (byte) 0xc9, (byte) 0x90, (byte) 0x31, (byte) 0xc6, (byte) 0x70, + (byte) 0x4d, (byte) 0x86, (byte) 0x7, (byte) 0x63, (byte) 0xdc, (byte) 0x5c, (byte) 0xf7, (byte) 0x63, + (byte) 0x9c, (byte) 0x21, (byte) 0x26, (byte) 0x43, (byte) 0xc2, (byte) 0x8d, (byte) 0x0, (byte) 0x26, + (byte) 0x10, (byte) 0xf7, (byte) 0x63, (byte) 0x92, (byte) 0x61, (byte) 0x4a, (byte) 0xc6, (byte) 0x34, + (byte) 0x66, (byte) 0xb8, (byte) 0x33, (byte) 0xc1, (byte) 0x90, (byte) 0x94, (byte) 0xd1, (byte) 0x8d, + (byte) 0x14, (byte) 0xc3, (byte) 0x4d, (byte) 0x3f, (byte) 0x6e, (byte) 0xc9, (byte) 0x8, (byte) 0xe2, + (byte) 0xb6, (byte) 0x0, (byte) 0x69, (byte) 0x41, (byte) 0x37, (byte) 0x74, (byte) 0x67, (byte) 0x51, + (byte) 0x80, (byte) 0x37, (byte) 0x3e, (byte) 0xb9, (byte) 0x21, (byte) 0x40, (byte) 0x7c, (byte) 0x6a, + (byte) 0x96, (byte) 0x35, (byte) 0x1, (byte) 0xc1, (byte) 0x8c, (byte) 0x6e, (byte) 0x68, (byte) 0xd9, + (byte) 0x7a, (byte) 0x75, (byte) 0x53, (byte) 0xb3, (byte) 0xb, (byte) 0xea, (byte) 0x66, (byte) 0x85, + (byte) 0x3c, (byte) 0x62, (byte) 0x55, (byte) 0xd5, (byte) 0xd, (byte) 0x1, (byte) 0x3, (byte) 0xf1, + (byte) 0xb7, (byte) 0x99, (byte) 0x6d, (byte) 0x75, (byte) 0x57, (byte) 0x4d, (byte) 0x55, (byte) 0x54, + (byte) 0x63, (byte) 0x2b, (byte) 0x95, (byte) 0x77, (byte) 0x6c, (byte) 0xdd, (byte) 0xd8, (byte) 0x9a, + (byte) 0xe7, (byte) 0x44, (byte) 0xbf, (byte) 0xad, (byte) 0xa9, (byte) 0xe5, (byte) 0x55, (byte) 0xd5, + (byte) 0xae, (byte) 0x9, (byte) 0xe8, (byte) 0xce, (byte) 0x3b, (byte) 0x6a, (byte) 0x69, (byte) 0x67, + (byte) 0x4d, (byte) 0xb5, (byte) 0x5c, (byte) 0x2a, (byte) 0xa5, (byte) 0xc8, (byte) 0x70, (byte) 0x87, + (byte) 0x12, (byte) 0xa3, (byte) 0xf0, (byte) 0x14, (byte) 0x59, (byte) 0x80, (byte) 0x9c, (byte) 0x37, + (byte) 0xeb, (byte) 0x76, (byte) 0x49, (byte) 0x5b, (byte) 0xd6, (byte) 0xb9, (byte) 0x6c, (byte) 0x70, + (byte) 0x9d, (byte) 0x68, (byte) 0x8f, (byte) 0xd, (byte) 0x87, (byte) 0x98, (byte) 0x49, (byte) 0xae, + (byte) 0xab, (byte) 0x20, (byte) 0x8c, (byte) 0x3e, (byte) 0xc2, (byte) 0xb4, (byte) 0xdd, (byte) 0xa, + (byte) 0x86, (byte) 0xb8, (byte) 0xa7, (byte) 0x47, (byte) 0x35, (byte) 0x9c, (byte) 0x6d, (byte) 0xd5, + (byte) 0x76, (byte) 0xb4, (byte) 0x9a, (byte) 0x43, (byte) 0x40, (byte) 0x5b, (byte) 0x40, (byte) 0xbf, + (byte) 0x9b, (byte) 0x46, (byte) 0xdd, (byte) 0xd1, (byte) 0x2b, (byte) 0xa9, (byte) 0xcf, (byte) 0xba, + (byte) 0x95, (byte) 0x7a, (byte) 0xa3, (byte) 0x5b, (byte) 0x5c, (byte) 0x91, (byte) 0xf3, (byte) 0x67, + (byte) 0x19, (byte) 0xe6, (byte) 0x14, (byte) 0xdc, (byte) 0xc5, (byte) 0x3d, (byte) 0x1, (byte) 0x83, + (byte) 0xb1, (byte) 0x5a, (byte) 0xd4, (byte) 0xb4, (byte) 0x34, (byte) 0x43, (byte) 0x2b, (byte) 0x47, + (byte) 0x77, (byte) 0x75, (byte) 0x35, (byte) 0xda, (byte) 0x2, (byte) 0xc5, (byte) 0xa8, (byte) 0x90, + (byte) 0x50, (byte) 0xbb, (byte) 0x8a, (byte) 0xdc, (byte) 0xe6, (byte) 0xb6, (byte) 0x56, (byte) 0x72, + (byte) 0x18, (byte) 0xee, (byte) 0x2b, (byte) 0x78, (byte) 0x80, (byte) 0xb4, (byte) 0x82, (byte) 0x79, + (byte) 0x1e, (byte) 0xaf, (byte) 0xaf, (byte) 0x7d, (byte) 0x5e, (byte) 0x78, (byte) 0x6f, (byte) 0x9b, + (byte) 0x1f, (byte) 0x78, (byte) 0x29, (byte) 0xa, (byte) 0x16, (byte) 0xf0, (byte) 0xf0, (byte) 0xf4, + (byte) 0x48, (byte) 0x37, (byte) 0x53, (byte) 0x2f, (byte) 0x72, (byte) 0xcf, (byte) 0x3e, (byte) 0x96, + (byte) 0x34, (byte) 0xcb, (byte) 0xd1, (byte) 0x4d, (byte) 0x12, (byte) 0x1c, (byte) 0x8e, (byte) 0x19, + (byte) 0xfc, (byte) 0x1d, (byte) 0xa7, (byte) 0x27, (byte) 0x4a, (byte) 0x51, (byte) 0xb3, (byte) 0xb9, + (byte) 0x42, (byte) 0x2b, (byte) 0x72, (byte) 0xcc, (byte) 0x50, (byte) 0xb0, (byte) 0xc8, (byte) 0x25, + (byte) 0x43, (byte) 0xff, (byte) 0x36, (byte) 0x8e, (byte) 0x8a, (byte) 0x88, (byte) 0x5f, (byte) 0xdc, + (byte) 0xcd, (byte) 0x4e, (byte) 0xe8, (byte) 0xa7, (byte) 0x9a, (byte) 0xa3, (byte) 0x55, (byte) 0x69, + (byte) 0x3e, (byte) 0x66, (byte) 0xdd, (byte) 0x21, (byte) 0x42, (byte) 0xe6, (byte) 0x34, (byte) 0xf8, + (byte) 0x2b, (byte) 0x2, (byte) 0x3b, (byte) 0x44, (byte) 0xd1, (byte) 0xd4, (byte) 0xea, (byte) 0x7c, + (byte) 0x47, (byte) 0x4e, (byte) 0x1d, (byte) 0x6e, (byte) 0x1a, (byte) 0xae, (byte) 0xc5, (byte) 0x77, + (byte) 0xef, (byte) 0x4, (byte) 0x2c, (byte) 0x5c, (byte) 0x10, (byte) 0xa7, (byte) 0x73, (byte) 0x90, + (byte) 0xcd, (byte) 0x16, (byte) 0xcc, (byte) 0x4f, (byte) 0xfe, (byte) 0x47, (byte) 0xdd, (byte) 0x57, + (byte) 0xaa, (byte) 0x98, (byte) 0x35, (byte) 0x9a, (byte) 0x56, (byte) 0xb7, (byte) 0x5a, (byte) 0x2e, + (byte) 0xe7, (byte) 0xeb, (byte) 0x96, (byte) 0x65, (byte) 0x6b, (byte) 0xb5, (byte) 0x9a, (byte) 0x56, + (byte) 0x16, (byte) 0x30, (byte) 0xd4, (byte) 0x29, (byte) 0x7b, (byte) 0xd6, (byte) 0x26, (byte) 0xb7, + (byte) 0x82, (byte) 0xa0, (byte) 0xd5, (byte) 0x54, (byte) 0xa0, (byte) 0x2f, (byte) 0xa1, (byte) 0x60, + (byte) 0xab, (byte) 0x25, (byte) 0xd, (byte) 0x63, (byte) 0xf4, (byte) 0x89, (byte) 0xca, (byte) 0xe0, + (byte) 0x8f, (byte) 0x17, (byte) 0x2, (byte) 0x9f, (byte) 0x32, (byte) 0xd9, (byte) 0x4b, (byte) 0xb4, + (byte) 0x1b, (byte) 0xa1, (byte) 0x55, (byte) 0xa0, (byte) 0xd5, (byte) 0x37, (byte) 0x75, (byte) 0x0, + (byte) 0x61, (byte) 0x9f, (byte) 0xfe, (byte) 0x50, (byte) 0x91, (byte) 0x64, (byte) 0x25, (byte) 0xd7, + (byte) 0x29, (byte) 0x21, (byte) 0x80, (byte) 0x1, (byte) 0xc, (byte) 0xb6, (byte) 0xa0, (byte) 0x13, + (byte) 0x24, (byte) 0xc1, (byte) 0xbd, (byte) 0x5d, (byte) 0x87, (byte) 0xf0, (byte) 0x14, (byte) 0xf, + (byte) 0xe0, (byte) 0x6d, (byte) 0x40, (byte) 0x6c, (byte) 0x13, (byte) 0xf8, (byte) 0x15, (byte) 0x0, + (byte) 0xfc, (byte) 0xb4, (byte) 0x6, (byte) 0xc8, (byte) 0x33, (byte) 0x74, (byte) 0xaa, (byte) 0x2f, + (byte) 0xac, (byte) 0x92, (byte) 0x8, (byte) 0xa3, (byte) 0x93, (byte) 0x6f, (byte) 0x61, (byte) 0x5f, + (byte) 0xe6, (byte) 0x10, (byte) 0x52, (byte) 0x71, (byte) 0xfa, (byte) 0x0, (byte) 0x6c, (byte) 0x4d, + (byte) 0xc8, (byte) 0x7e, (byte) 0x87, (byte) 0x3f, (byte) 0x1c, (byte) 0x10, (byte) 0x7f, (byte) 0x42, + (byte) 0x2e, (byte) 0x7a, (byte) 0xa7, (byte) 0xf3, (byte) 0xd, (byte) 0x74, (byte) 0xbd, (byte) 0x9e, + (byte) 0x39, (byte) 0xc6, (byte) 0xcb, (byte) 0xc4, (byte) 0x31, (byte) 0xfa, (byte) 0x67, (byte) 0x1a, + (byte) 0x50, (byte) 0xf6, (byte) 0xb0, (byte) 0x94, (byte) 0x16, (byte) 0x13, (byte) 0x11, (byte) 0xb1, + (byte) 0x81, (byte) 0x9e, (byte) 0x3d, (byte) 0xcc, (byte) 0x35, (byte) 0x3d, (byte) 0xc9, (byte) 0xb4, + (byte) 0x18, (byte) 0x11, (byte) 0xb3, (byte) 0x11, (byte) 0xf1, (byte) 0x28, (byte) 0xed, (byte) 0x23, + (byte) 0xe8, (byte) 0x48, (byte) 0x1b, (byte) 0x1a, (byte) 0x4e, (byte) 0x4b, (byte) 0x89, (byte) 0x88, + (byte) 0xe4, (byte) 0x42, (byte) 0x19, (byte) 0xf7, (byte) 0x44, (byte) 0x7c, (byte) 0x47, (byte) 0x7b, + (byte) 0x88, (byte) 0xac, (byte) 0xf1, (byte) 0x0, (byte) 0xa1, (byte) 0x73, (byte) 0x1, (byte) 0x1a, + (byte) 0xe8, (byte) 0xdd, (byte) 0xa7, (byte) 0x64, (byte) 0x26, (byte) 0xe8, (byte) 0x42, (byte) 0x26, + (byte) 0xe9, (byte) 0x1e, (byte) 0xf6, (byte) 0x60, (byte) 0x14, (byte) 0x4b, (byte) 0xad, (byte) 0x75, + (byte) 0x85, (byte) 0x12, (byte) 0x5c, (byte) 0xc7, (byte) 0x6, (byte) 0x8a, (byte) 0xb4, (byte) 0x5f, + (byte) 0xc2, (byte) 0xaa, (byte) 0xbb, (byte) 0xf7, (byte) 0x62, (byte) 0x7, (byte) 0x6, (byte) 0x5d, + (byte) 0x52, (byte) 0x8f, (byte) 0x5b, (byte) 0x5e, (byte) 0x12, (byte) 0x5d, (byte) 0x64, (byte) 0x15, + (byte) 0xf2, (byte) 0x72, (byte) 0x6, (byte) 0xe7, (byte) 0x4, (byte) 0x5d, (byte) 0xf6, (byte) 0xa, + (byte) 0xad, (byte) 0x3b, (byte) 0xd4, (byte) 0x4e, (byte) 0x8e, (byte) 0x34, (byte) 0x11, (byte) 0xc2, + (byte) 0x17, (byte) 0xf4, (byte) 0xe2, (byte) 0x2b, (byte) 0x15, (byte) 0x1e, (byte) 0x21, (byte) 0x74, + (byte) 0xe, (byte) 0xf2, (byte) 0x9, (byte) 0x11, (byte) 0x45, (byte) 0x86, (byte) 0x61, (byte) 0x86, + (byte) 0xcb, (byte) 0xc, (byte) 0x57, (byte) 0x18, (byte) 0xef, (byte) 0x36, (byte) 0x19, (byte) 0x79, + (byte) 0x99, (byte) 0xcc, (byte) 0x73, (byte) 0xfa, (byte) 0x9d, (byte) 0x10, (byte) 0x43, (byte) 0x3a, + (byte) 0x77, (byte) 0x7c, (byte) 0x6, (byte) 0xf1, (byte) 0x9e, (byte) 0x50, (byte) 0x64, (byte) 0x4f, + (byte) 0xf3, (byte) 0xc, (byte) 0x78, (byte) 0xc2, (byte) 0x70, (byte) 0xb5, (byte) 0x9f, (byte) 0x3a, + (byte) 0x3a, (byte) 0x4a, (byte) 0xb2, (byte) 0x1e, (byte) 0x44, (byte) 0xff, (byte) 0x2, (byte) 0x50, + (byte) 0x4b, (byte) 0x1, (byte) 0x2, (byte) 0x2d, (byte) 0x3, (byte) 0x2d, (byte) 0x0, (byte) 0x0, + (byte) 0x8, (byte) 0x0, (byte) 0x0, (byte) 0x18, (byte) 0x7e, (byte) 0xe, (byte) 0x57, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x9, (byte) 0x0, (byte) 0x32, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0xed, + (byte) 0x41, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x4d, (byte) 0x45, (byte) 0x54, + (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, (byte) 0x2f, (byte) 0x1, (byte) 0x0, + (byte) 0x18, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0xfe, (byte) 0xca, (byte) 0x0, (byte) 0x0, (byte) 0x75, (byte) 0x70, + (byte) 0xe, (byte) 0x0, (byte) 0x1, (byte) 0x8, (byte) 0xa1, (byte) 0x8c, (byte) 0x13, (byte) 0x4d, + (byte) 0x45, (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, (byte) 0x2f, + (byte) 0x50, (byte) 0x4b, (byte) 0x1, (byte) 0x2, (byte) 0x2d, (byte) 0x3, (byte) 0x2d, (byte) 0x0, + (byte) 0x0, (byte) 0x8, (byte) 0x8, (byte) 0x0, (byte) 0x17, (byte) 0x7e, (byte) 0xe, (byte) 0x57, + (byte) 0x31, (byte) 0x59, (byte) 0x76, (byte) 0x4d, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x14, (byte) 0x0, (byte) 0x39, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0xa4, (byte) 0x81, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x4d, (byte) 0x45, + (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, (byte) 0x2f, (byte) 0x4d, + (byte) 0x41, (byte) 0x4e, (byte) 0x49, (byte) 0x46, (byte) 0x45, (byte) 0x53, (byte) 0x54, (byte) 0x2e, + (byte) 0x4d, (byte) 0x46, (byte) 0x1, (byte) 0x0, (byte) 0x18, (byte) 0x0, (byte) 0x6e, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x61, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x51, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x75, (byte) 0x70, + (byte) 0x19, (byte) 0x0, (byte) 0x1, (byte) 0x85, (byte) 0x85, (byte) 0x84, (byte) 0x2, (byte) 0x4d, + (byte) 0x45, (byte) 0x54, (byte) 0x41, (byte) 0x2d, (byte) 0x49, (byte) 0x4e, (byte) 0x46, (byte) 0x2f, + (byte) 0x4d, (byte) 0x41, (byte) 0x4e, (byte) 0x49, (byte) 0x46, (byte) 0x45, (byte) 0x53, (byte) 0x54, + (byte) 0x2e, (byte) 0x4d, (byte) 0x46, (byte) 0x50, (byte) 0x4b, (byte) 0x1, (byte) 0x2, (byte) 0x2d, + (byte) 0x3, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x8, (byte) 0x8, (byte) 0x0, (byte) 0x67, + (byte) 0x37, (byte) 0xb, (byte) 0x57, (byte) 0x3f, (byte) 0xa5, (byte) 0x4f, (byte) 0x5e, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x10, + (byte) 0x0, (byte) 0x35, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xa4, (byte) 0x81, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0x52, (byte) 0x65, (byte) 0x61, (byte) 0x64, (byte) 0x41, (byte) 0x6e, (byte) 0x74, + (byte) 0x4a, (byte) 0x61, (byte) 0x72, (byte) 0x2e, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x73, + (byte) 0x73, (byte) 0x1, (byte) 0x0, (byte) 0x18, (byte) 0x0, (byte) 0x87, (byte) 0x4, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xc7, (byte) 0x2, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x15, (byte) 0x1, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x75, (byte) 0x70, (byte) 0x15, + (byte) 0x0, (byte) 0x1, (byte) 0x94, (byte) 0x82, (byte) 0x60, (byte) 0x61, (byte) 0x52, (byte) 0x65, + (byte) 0x61, (byte) 0x64, (byte) 0x41, (byte) 0x6e, (byte) 0x74, (byte) 0x4a, (byte) 0x61, (byte) 0x72, + (byte) 0x2e, (byte) 0x63, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x50, (byte) 0x4b, + (byte) 0x6, (byte) 0x6, (byte) 0x2c, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x2d, (byte) 0x0, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x57, (byte) 0x1, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x37, (byte) 0x4, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x50, (byte) 0x4b, + (byte) 0x6, (byte) 0x7, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x8e, (byte) 0x5, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x50, (byte) 0x4b, (byte) 0x5, (byte) 0x6, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x3, (byte) 0x0, (byte) 0x57, (byte) 0x1, + (byte) 0x0, (byte) 0x0, (byte) 0x37, (byte) 0x4, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + }; + + /* + * ----------------#1-------------------- + * [Central Directory Header] + * 0x47: Signature : 0x02014b50 + * 0x4b: Created Zip Spec : 0x2d [4.5] + * 0x4c: Created OS : 0x3 [UNIX] + * 0x4d: VerMadeby : 0x32d [3, 4.5] + * 0x4e: VerExtract : 0x2d [4.5] + * 0x4f: Flag : 0x800 + * 0x51: Method : 0x8 [DEFLATED] + * 0x53: Last Mod Time : 0x570375bc [Thu Aug 03 14:45:56 EDT 2023] + * 0x57: CRC : 0x0 + * 0x5b: Compressed Size : 0x2 + * 0x5f: Uncompressed Size: 0x0 + * * 0x63: Name Length : 0x5 + * 0x65: Extra Length : 0x12 + * Extra data:[01, 00, 00, 00, 75, 70, 0a, 00, 01, ba, f7, eb, c1, 61, 2e, 74, 78, 74] + * [tag=0x0001, sz=0] + * ->ZIP64: + * [tag=0x7075, sz=10] + * ->[Unknown tag] + * [data= 01 ba f7 eb c1 61 2e 74 78 74 ] + * 0x67: Comment Length : 0x0 + * 0x69: Disk Start : 0x0 + * 0x6b: Attrs : 0x0 + * 0x6d: AttrsEx : 0x81a40000 + * 0x71: Loc Header Offset: 0x0 + * 0x75: File Name : a.txt + */ + public static byte[] ANT_ZIP64_UNICODE_EXTRA_ZIP= { + (byte) 0x50, (byte) 0x4b, (byte) 0x3, (byte) 0x4, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x8, + (byte) 0x8, (byte) 0x0, (byte) 0xbc, (byte) 0x75, (byte) 0x3, (byte) 0x57, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0x5, (byte) 0x0, (byte) 0x22, (byte) 0x0, (byte) 0x61, (byte) 0x2e, + (byte) 0x74, (byte) 0x78, (byte) 0x74, (byte) 0x1, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x75, + (byte) 0x70, (byte) 0xa, (byte) 0x0, (byte) 0x1, (byte) 0xba, (byte) 0xf7, (byte) 0xeb, (byte) 0xc1, + (byte) 0x61, (byte) 0x2e, (byte) 0x74, (byte) 0x78, (byte) 0x74, (byte) 0x3, (byte) 0x0, (byte) 0x50, + (byte) 0x4b, (byte) 0x1, (byte) 0x2, (byte) 0x2d, (byte) 0x3, (byte) 0x2d, (byte) 0x0, (byte) 0x0, + (byte) 0x8, (byte) 0x8, (byte) 0x0, (byte) 0xbc, (byte) 0x75, (byte) 0x3, (byte) 0x57, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x5, (byte) 0x0, (byte) 0x12, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xa4, + (byte) 0x81, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x61, (byte) 0x2e, (byte) 0x74, + (byte) 0x78, (byte) 0x74, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x75, (byte) 0x70, + (byte) 0xa, (byte) 0x0, (byte) 0x1, (byte) 0xba, (byte) 0xf7, (byte) 0xeb, (byte) 0xc1, (byte) 0x61, + (byte) 0x2e, (byte) 0x74, (byte) 0x78, (byte) 0x74, (byte) 0x50, (byte) 0x4b, (byte) 0x6, (byte) 0x6, + (byte) 0x2c, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x2d, (byte) 0x0, (byte) 0x2d, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x45, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x47, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x50, (byte) 0x4b, (byte) 0x6, (byte) 0x7, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x8c, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x50, (byte) 0x4b, (byte) 0x5, (byte) 0x6, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x1, (byte) 0x0, (byte) 0x1, (byte) 0x0, (byte) 0x45, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x47, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + }; + + // Name of Zip file and Jar File used by the test + public static final Path VALID_APK = Path.of("working-apk.zip"); + public static final Path VALID_APACHE_COMPRESS_JAR = + Path.of("valid-apache-compress.jar"); + public static final Path VALID_ANT_JAR = + Path.of("valid-ant-zip64-unicode-extrafields.jar"); + public static final Path VALID_ANT_ZIP = + Path.of("valid-ant-zip64-unicode-extrafields.zip"); + /** + * Setup method used to create the Zip and Jar files used by the test + * @throws IOException if an error occurs + */ + @BeforeAll + public static void setup() throws IOException { + Files.deleteIfExists(VALID_APK); + Files.deleteIfExists(VALID_APACHE_COMPRESS_JAR); + Files.deleteIfExists(VALID_ANT_JAR); + Files.deleteIfExists(VALID_ANT_ZIP); + + // Create the Zip file to read + Files.write(VALID_APK, VALID_APK_FILE); + Files.write(VALID_APACHE_COMPRESS_JAR, COMMONS_COMPRESS_JAR); + Files.write(VALID_ANT_JAR, ANT_ZIP64_UNICODE_EXTRA_JAR); + Files.write(VALID_ANT_ZIP, ANT_ZIP64_UNICODE_EXTRA_ZIP); + + } + + /** + * Zip and Jars files to validate we can open + */ + private static Stream zipFilesToTest() { + return Stream.of(VALID_APK, VALID_APACHE_COMPRESS_JAR, VALID_ANT_JAR, VALID_ANT_ZIP); + } + + /** + * Validate that a Zip file which contains an extra header with a data size + * 0f 0 can be opened using ZipFile + * @throws IOException if an error occurs + */ + @ParameterizedTest + @MethodSource("zipFilesToTest") + public void zipFilesToTest(Path jar) throws IOException { + try (ZipFile zf = new ZipFile(jar.toFile())) { + System.out.printf("%s opened%n", jar.toAbsolutePath()); + } catch (IOException ie) { + System.out.printf("%n%n%n$$$$ %s NOT opened%n", jar.toAbsolutePath()); + throw ie; + } + } + + /** + * Validate that a Zip file which contains an extra header with a data size + * 0f 0 can be opened using ZipFS + * @throws IOException if an error occurs + */ + @ParameterizedTest + @MethodSource("zipFilesToTest") + public void readZipFSTest(Path jar) throws IOException { + try (FileSystem fs = FileSystems.newFileSystem(jar, Map.of())) { + System.out.printf("%s opened%n", jar.toAbsolutePath()); + } catch (IOException ie) { + System.out.printf("%n%n%n$$$$ %s NOT opened%n", jar.toAbsolutePath()); + throw ie; + } + } + /** + * Utility method which takes a byte array and converts to byte array + * declaration. For example: + *
    +     *     {@code
    +     *        var fooJar = Files.readAllBytes(Path.of("foo.jar"));
    +     *        var result = createByteArray(fooJar, "FOOBYTES");
    +     *        System.out.println(result);
    +     *      }
    +     * 
    + * + * @param bytes A byte array used to create a byte array declaration + * @param name Name to be used in the byte array declaration + * @return The formatted byte array declaration + */ + public static String createByteArray(byte[] bytes, String name) { + StringBuilder sb = new StringBuilder(bytes.length * 5); + Formatter fmt = new Formatter(sb); + fmt.format(" public static byte[] %s = {", name); + final int linelen = 8; + for (int i = 0; i < bytes.length; i++) { + if (i % linelen == 0) { + fmt.format("%n "); + } + fmt.format(" (byte) 0x%x,", bytes[i] & 0xff); + } + fmt.format("%n };%n"); + return sb.toString(); + } +} From b32d6411c406608ba5f7d60bfb8d935adb876564 Mon Sep 17 00:00:00 2001 From: Glavo Date: Wed, 16 Aug 2023 17:37:21 +0000 Subject: [PATCH 078/162] 8311943: Cleanup usages of toLowerCase() and toUpperCase() in java.base Reviewed-by: naoto --- .../classes/apple/security/KeychainStore.java | 39 ++++++++++--------- .../share/classes/java/net/ProxySelector.java | 6 ++- .../share/classes/java/security/KeyStore.java | 4 +- .../time/format/DateTimeFormatterBuilder.java | 2 +- .../jdk/internal/util/xml/impl/Parser.java | 13 ++++--- .../classes/sun/launcher/LauncherHelper.java | 2 +- .../sun/net/spi/DefaultProxySelector.java | 2 +- .../http/ntlm/NTLMAuthentication.java | 3 +- .../classes/sun/nio/fs/UnixFileStore.java | 2 +- .../classes/java/lang/ProcessImpl.java | 4 +- .../http/ntlm/NTLMAuthentication.java | 5 ++- 11 files changed, 44 insertions(+), 38 deletions(-) diff --git a/src/java.base/macosx/classes/apple/security/KeychainStore.java b/src/java.base/macosx/classes/apple/security/KeychainStore.java index 83c4265423a..0b60399990c 100644 --- a/src/java.base/macosx/classes/apple/security/KeychainStore.java +++ b/src/java.base/macosx/classes/apple/security/KeychainStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -181,7 +181,7 @@ public Key engineGetKey(String alias, char[] password) password = Long.toString(random.nextLong()).toCharArray(); } - Object entry = entries.get(alias.toLowerCase()); + Object entry = entries.get(alias.toLowerCase(Locale.ROOT)); if (!(entry instanceof KeyEntry keyEntry)) { return null; @@ -271,7 +271,7 @@ public Key engineGetKey(String alias, char[] password) public Certificate[] engineGetCertificateChain(String alias) { permissionCheck(); - Object entry = entries.get(alias.toLowerCase()); + Object entry = entries.get(alias.toLowerCase(Locale.ROOT)); if (entry instanceof KeyEntry keyEntry) { if (keyEntry.chain == null) { @@ -302,7 +302,7 @@ public Certificate[] engineGetCertificateChain(String alias) { public Certificate engineGetCertificate(String alias) { permissionCheck(); - Object entry = entries.get(alias.toLowerCase()); + Object entry = entries.get(alias.toLowerCase(Locale.ROOT)); if (entry != null) { if (entry instanceof TrustedCertEntry) { @@ -337,7 +337,7 @@ public String getValue() { public KeyStore.Entry engineGetEntry(String alias, KeyStore.ProtectionParameter protParam) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException { if (engineIsCertificateEntry(alias)) { - Object entry = entries.get(alias.toLowerCase()); + Object entry = entries.get(alias.toLowerCase(Locale.ROOT)); if (entry instanceof TrustedCertEntry tEntry) { return new KeyStore.TrustedCertificateEntry( tEntry.cert, Set.of( @@ -359,7 +359,7 @@ public KeyStore.Entry engineGetEntry(String alias, KeyStore.ProtectionParameter public Date engineGetCreationDate(String alias) { permissionCheck(); - Object entry = entries.get(alias.toLowerCase()); + Object entry = entries.get(alias.toLowerCase(Locale.ROOT)); if (entry != null) { if (entry instanceof TrustedCertEntry) { @@ -427,7 +427,7 @@ public void engineSetKeyEntry(String alias, Key key, char[] password, entry.chainRefs = new long[entry.chain.length]; } - String lowerAlias = alias.toLowerCase(); + String lowerAlias = alias.toLowerCase(Locale.ROOT); if (entries.get(lowerAlias) != null) { deletedEntries.put(lowerAlias, entries.get(lowerAlias)); } @@ -491,7 +491,7 @@ public void engineSetKeyEntry(String alias, byte[] key, entry.chainRefs = new long[entry.chain.length]; } - String lowerAlias = alias.toLowerCase(); + String lowerAlias = alias.toLowerCase(Locale.ROOT); if (entries.get(lowerAlias) != null) { deletedEntries.put(lowerAlias, entries.get(alias)); } @@ -521,9 +521,10 @@ public void engineDeleteEntry(String alias) { permissionCheck(); + String lowerAlias = alias.toLowerCase(Locale.ROOT); synchronized(entries) { - Object entry = entries.remove(alias.toLowerCase()); - deletedEntries.put(alias.toLowerCase(), entry); + Object entry = entries.remove(lowerAlias); + deletedEntries.put(lowerAlias, entry); } } @@ -546,7 +547,7 @@ public Enumeration engineAliases() { */ public boolean engineContainsAlias(String alias) { permissionCheck(); - return entries.containsKey(alias.toLowerCase()); + return entries.containsKey(alias.toLowerCase(Locale.ROOT)); } /** @@ -568,7 +569,7 @@ public int engineSize() { */ public boolean engineIsKeyEntry(String alias) { permissionCheck(); - Object entry = entries.get(alias.toLowerCase()); + Object entry = entries.get(alias.toLowerCase(Locale.ROOT)); return entry instanceof KeyEntry; } @@ -581,7 +582,7 @@ public boolean engineIsKeyEntry(String alias) { */ public boolean engineIsCertificateEntry(String alias) { permissionCheck(); - Object entry = entries.get(alias.toLowerCase()); + Object entry = entries.get(alias.toLowerCase(Locale.ROOT)); return entry instanceof TrustedCertEntry; } @@ -806,10 +807,10 @@ private void createTrustedCertEntry(String alias, List inputTrust, // Check whether a certificate with same alias already exists and is the same // If yes, we can return here - the existing entry must have the same // properties and trust settings - if (entries.contains(alias.toLowerCase())) { + if (entries.contains(alias.toLowerCase(Locale.ROOT))) { int uniqueVal = 1; String originalAlias = alias; - var co = entries.get(alias.toLowerCase()); + var co = entries.get(alias.toLowerCase(Locale.ROOT)); while (co != null) { if (co instanceof TrustedCertEntry tco) { if (tco.cert.equals(tce.cert)) { @@ -817,7 +818,7 @@ private void createTrustedCertEntry(String alias, List inputTrust, } } alias = originalAlias + " " + uniqueVal++; - co = entries.get(alias.toLowerCase()); + co = entries.get(alias.toLowerCase(Locale.ROOT)); } } @@ -900,7 +901,7 @@ private void createTrustedCertEntry(String alias, List inputTrust, else tce.date = new Date(); - entries.put(alias.toLowerCase(), tce); + entries.put(alias.toLowerCase(Locale.ROOT), tce); } catch (Exception e) { // The certificate will be skipped. System.err.println("KeychainStore Ignored Exception: " + e); @@ -971,12 +972,12 @@ private void createKeyEntry(String alias, long creationDate, long secKeyRef, int uniqueVal = 1; String originalAlias = alias; - while (entries.containsKey(alias.toLowerCase())) { + while (entries.containsKey(alias.toLowerCase(Locale.ROOT))) { alias = originalAlias + " " + uniqueVal; uniqueVal++; } - entries.put(alias.toLowerCase(), ke); + entries.put(alias.toLowerCase(Locale.ROOT), ke); } private static class CertKeychainItemPair { diff --git a/src/java.base/share/classes/java/net/ProxySelector.java b/src/java.base/share/classes/java/net/ProxySelector.java index b9b800a5328..f29c6738c52 100644 --- a/src/java.base/share/classes/java/net/ProxySelector.java +++ b/src/java.base/share/classes/java/net/ProxySelector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ import java.io.IOException; import java.util.List; +import java.util.Locale; + import sun.security.util.SecurityConstants; /** @@ -210,7 +212,7 @@ public void connectFailed(URI uri, SocketAddress sa, IOException e) { @Override public synchronized List select(URI uri) { - String scheme = uri.getScheme().toLowerCase(); + String scheme = uri.getScheme().toLowerCase(Locale.ROOT); if (scheme.equals("http") || scheme.equals("https")) { return list; } else { diff --git a/src/java.base/share/classes/java/security/KeyStore.java b/src/java.base/share/classes/java/security/KeyStore.java index 01edb885726..9b0db30abba 100644 --- a/src/java.base/share/classes/java/security/KeyStore.java +++ b/src/java.base/share/classes/java/security/KeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -817,7 +817,7 @@ protected KeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type) this.type = type; if (!skipDebug && pdebug != null) { - pdebug.println("KeyStore." + type.toUpperCase() + " type from: " + + pdebug.println("KeyStore." + type.toUpperCase(Locale.ROOT) + " type from: " + getProviderName()); } } diff --git a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java index b55d0232a18..edd5e16f8a5 100644 --- a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -4725,7 +4725,7 @@ public int parse(DateTimeParseContext context, CharSequence text, int position) * @return the position after the parse */ private int parseOffsetBased(DateTimeParseContext context, CharSequence text, int prefixPos, int position, OffsetIdPrinterParser parser) { - String prefix = text.subSequence(prefixPos, position).toString().toUpperCase(); + String prefix = text.subSequence(prefixPos, position).toString().toUpperCase(Locale.ROOT); if (position >= text.length()) { context.setParsed(ZoneId.of(prefix)); return position; diff --git a/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java b/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java index 4a6ab3d86a0..36ec2ae42a5 100644 --- a/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java +++ b/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.io.UnsupportedEncodingException; import java.util.Arrays; import java.util.HashMap; +import java.util.Locale; import java.util.Map; import jdk.internal.org.xml.sax.InputSource; import jdk.internal.org.xml.sax.SAXException; @@ -1601,7 +1602,7 @@ private void pi() throws Exception { // PI target name may not be empty string [#2.6] // PI target name 'XML' is reserved [#2.6] if ((str.isEmpty()) - || (mXml.name.equals(str.toLowerCase()) == true)) { + || (mXml.name.equals(str.toLowerCase(Locale.ROOT)) == true)) { panic(FAULT); } // This is processing instruction @@ -2858,7 +2859,7 @@ protected void setinp(InputSource is) String expenc; if (is.getEncoding() != null) { // Ignore encoding in the xml text decl. - expenc = is.getEncoding().toUpperCase(); + expenc = is.getEncoding().toUpperCase(Locale.ROOT); if (expenc.equals("UTF-16")) { reader = bom(is.getByteStream(), 'U'); // UTF-16 [#4.3.3] } else { @@ -3156,7 +3157,7 @@ private String xml(Reader reader) case 'A': case '_': bkch(); - str = name(false).toLowerCase(); + str = name(false).toLowerCase(Locale.ROOT); if ("version".equals(str) == true) { if (st != 1) { panic(FAULT); @@ -3170,7 +3171,7 @@ private String xml(Reader reader) if (st != 2) { panic(FAULT); } - mInp.xmlenc = eqstr('=').toUpperCase(); + mInp.xmlenc = eqstr('=').toUpperCase(Locale.ROOT); enc = mInp.xmlenc; st = 3; } else if ("standalone".equals(str) == true) { @@ -3178,7 +3179,7 @@ private String xml(Reader reader) { panic(FAULT); } - str = eqstr('=').toLowerCase(); + str = eqstr('=').toLowerCase(Locale.ROOT); // Check the 'standalone' value and use it [#5.1] if (str.equals("yes") == true) { mIsSAlone = true; diff --git a/src/java.base/share/classes/sun/launcher/LauncherHelper.java b/src/java.base/share/classes/sun/launcher/LauncherHelper.java index 0ff9416cb23..d30f61d9e2b 100644 --- a/src/java.base/share/classes/sun/launcher/LauncherHelper.java +++ b/src/java.base/share/classes/sun/launcher/LauncherHelper.java @@ -1315,7 +1315,7 @@ public int compare(ModuleReference a, ModuleReference b) { } private static Stream toStringStream(Set s) { - return s.stream().map(e -> e.toString().toLowerCase()); + return s.stream().map(e -> e.toString().toLowerCase(Locale.ROOT)); } private static boolean isJrt(ModuleReference mref) { diff --git a/src/java.base/share/classes/sun/net/spi/DefaultProxySelector.java b/src/java.base/share/classes/sun/net/spi/DefaultProxySelector.java index fcc4a4862d6..c944bef91e7 100644 --- a/src/java.base/share/classes/sun/net/spi/DefaultProxySelector.java +++ b/src/java.base/share/classes/sun/net/spi/DefaultProxySelector.java @@ -377,7 +377,7 @@ static Pattern toPattern(String mask) { if (disjunct.isEmpty()) continue; disjunctionEmpty = false; - String regex = disjunctToRegex(disjunct.toLowerCase()); + String regex = disjunctToRegex(disjunct.toLowerCase(Locale.ROOT)); joiner.add(regex); } return disjunctionEmpty ? null : Pattern.compile(joiner.toString()); diff --git a/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java b/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java index 72ef34c5f0f..050e12e3594 100644 --- a/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java +++ b/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java @@ -34,6 +34,7 @@ import java.net.URL; import java.security.GeneralSecurityException; import java.util.Base64; +import java.util.Locale; import java.util.Objects; import java.util.Properties; @@ -149,7 +150,7 @@ private void init (PasswordAuthentication pw) { username = s; ntdomain = defaultDomain; } else { - ntdomain = s.substring (0, i).toUpperCase(); + ntdomain = s.substring (0, i).toUpperCase(Locale.ROOT); username = s.substring (i+1); } password = pw.getPassword(); diff --git a/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java b/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java index 7f9348a81cb..6704a588d10 100644 --- a/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java +++ b/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java @@ -288,7 +288,7 @@ public Properties run() { if (value != null) { String[] values = value.split("\\s"); for (String s: values) { - s = s.trim().toLowerCase(); + s = s.trim().toLowerCase(Locale.ROOT); if (s.equals(feature)) { return FeatureStatus.PRESENT; } diff --git a/src/java.base/windows/classes/java/lang/ProcessImpl.java b/src/java.base/windows/classes/java/lang/ProcessImpl.java index dccc1a60891..a01d1db6ddc 100644 --- a/src/java.base/windows/classes/java/lang/ProcessImpl.java +++ b/src/java.base/windows/classes/java/lang/ProcessImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -393,7 +393,7 @@ private boolean isExe(String executablePath) { // Old version that can be bypassed private boolean isShellFile(String executablePath) { - String upPath = executablePath.toUpperCase(); + String upPath = executablePath.toUpperCase(Locale.ROOT); return (upPath.endsWith(".CMD") || upPath.endsWith(".BAT")); } diff --git a/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java b/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java index d9eaabe2b4f..d3b60daad74 100644 --- a/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java +++ b/src/java.base/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java @@ -30,6 +30,7 @@ import java.net.PasswordAuthentication; import java.net.UnknownHostException; import java.net.URL; +import java.util.Locale; import java.util.Objects; import java.util.Properties; import sun.net.NetProperties; @@ -95,7 +96,7 @@ private void init0() { public String run() { String localhost; try { - localhost = InetAddress.getLocalHost().getHostName().toUpperCase(); + localhost = InetAddress.getLocalHost().getHostName().toUpperCase(Locale.ROOT); } catch (UnknownHostException e) { localhost = "localhost"; } @@ -136,7 +137,7 @@ private void init (PasswordAuthentication pw) { username = s; ntdomain = defaultDomain; } else { - ntdomain = s.substring (0, i).toUpperCase(); + ntdomain = s.substring (0, i).toUpperCase(Locale.ROOT); username = s.substring (i+1); } password = new String (pw.getPassword()); From 7b28d3608a10b26af376c8f6d142d97c708c9f11 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Wed, 16 Aug 2023 17:49:38 +0000 Subject: [PATCH 079/162] 8314330: java/foreign tests should respect vm flags when start new processes Reviewed-by: jvernee --- test/jdk/java/foreign/UpcallTestHelper.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/test/jdk/java/foreign/UpcallTestHelper.java b/test/jdk/java/foreign/UpcallTestHelper.java index 3860080cf21..bbfa44aa346 100644 --- a/test/jdk/java/foreign/UpcallTestHelper.java +++ b/test/jdk/java/foreign/UpcallTestHelper.java @@ -21,13 +21,12 @@ * questions. */ -import jdk.test.lib.Utils; +import jdk.test.lib.process.ProcessTools; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -57,22 +56,15 @@ public Output runInNewProcess(Class target, boolean useSpec, String... progra assert !target.isArray(); List command = new ArrayList<>(List.of( - Paths.get(Utils.TEST_JDK) - .resolve("bin") - .resolve("java") - .toAbsolutePath() - .toString(), "--enable-preview", "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=" + System.getProperty("java.library.path"), "-Djdk.internal.foreign.UpcallLinker.USE_SPEC=" + useSpec, - "-cp", Utils.TEST_CLASS_PATH, target.getName() )); command.addAll(Arrays.asList(programArgs)); - Process process = new ProcessBuilder() - .command(command) - .start(); + + Process process = ProcessTools.createTestJvm(command).start(); int result = process.waitFor(); assertNotEquals(result, 0); From 6b396da278094d7109ad2fbe7a1a52a500e15d75 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Wed, 16 Aug 2023 17:53:56 +0000 Subject: [PATCH 080/162] 8062795: (fs) Files.setPermissions requires read access when NOFOLLOW_LINKS specified Reviewed-by: alanb --- .../sun/nio/fs/UnixFileAttributeViews.java | 46 ++++++++++++++---- .../PosixFileAttributeView/Basic.java | 48 +++++++++++++++++-- 2 files changed, 80 insertions(+), 14 deletions(-) diff --git a/src/java.base/unix/classes/sun/nio/fs/UnixFileAttributeViews.java b/src/java.base/unix/classes/sun/nio/fs/UnixFileAttributeViews.java index f35541a9e19..94e0f91e812 100644 --- a/src/java.base/unix/classes/sun/nio/fs/UnixFileAttributeViews.java +++ b/src/java.base/unix/classes/sun/nio/fs/UnixFileAttributeViews.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ import java.util.concurrent.TimeUnit; import java.io.IOException; +import static sun.nio.fs.UnixConstants.*; import static sun.nio.fs.UnixNativeDispatcher.*; class UnixFileAttributeViews { @@ -262,19 +263,44 @@ public UnixFileAttributes readAttributes() throws IOException { // chmod final void setMode(int mode) throws IOException { checkWriteExtended(); - try { - if (followLinks) { + + if (followLinks) { + try { chmod(file, mode); - } else { - int fd = file.openForAttributeAccess(false); + } catch (UnixException e) { + e.rethrowAsIOException(file); + } + return; + } + + if (O_NOFOLLOW == 0) { + throw new IOException("NOFOLLOW_LINKS is not supported on this platform"); + } + + int fd = -1; + try { + fd = open(file, O_RDONLY, O_NOFOLLOW); + } catch (UnixException e1) { + if (e1.errno() == EACCES) { + // retry with write access if there is no read permission try { - fchmod(fd, mode); - } finally { - close(fd); + fd = open(file, O_WRONLY, O_NOFOLLOW); + } catch (UnixException e2) { + e2.rethrowAsIOException(file); } + } else { + e1.rethrowAsIOException(file); } - } catch (UnixException x) { - x.rethrowAsIOException(file); + } + + try { + try { + fchmod(fd, mode); + } finally { + close(fd); + } + } catch (UnixException e) { + e.rethrowAsIOException(file); } } diff --git a/test/jdk/java/nio/file/attribute/PosixFileAttributeView/Basic.java b/test/jdk/java/nio/file/attribute/PosixFileAttributeView/Basic.java index 1ce0c6031cd..6626a289dce 100644 --- a/test/jdk/java/nio/file/attribute/PosixFileAttributeView/Basic.java +++ b/test/jdk/java/nio/file/attribute/PosixFileAttributeView/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ */ /* @test - * @bug 4313887 6838333 + * @bug 4313887 6838333 8062795 * @summary Unit test for java.nio.file.attribute.PosixFileAttributeView * @library ../.. */ @@ -167,9 +167,9 @@ static void permissionTests(Path dir) Files.delete(file); } - // create link (to file that doesn't exist) and test reading of - // permissions if (TestUtil.supportsLinks(dir)) { + // create link (to file that doesn't exist) and test reading of + // permissions Path link = dir.resolve("link"); System.out.format("create link %s\n", link); Files.createSymbolicLink(link, file); @@ -185,6 +185,46 @@ static void permissionTests(Path dir) } finally { Files.delete(link); } + + // test that setting permissions on paths with and without + // links succeeds when the NOFOLLOW_LINKS option is set + + // ensure there are no links in the path to test + Path realDir = dir.toRealPath(); + + // realDir/a/b/c/d + Path leaf = realDir.resolve(Path.of("a", "b", "c", "d")); + Files.createDirectories(leaf); + + // realDir/a/b/c/d/FUBAR + Path sansLinks = Files.createTempFile(leaf, "FU", "BAR"); + + PosixFileAttributeView sansView = + Files.getFileAttributeView(sansLinks, + PosixFileAttributeView.class, + LinkOption.NOFOLLOW_LINKS); + sansView.setPermissions(Set.of(PosixFilePermission.OWNER_WRITE)); + sansView.setPermissions(Set.of(PosixFilePermission.OWNER_WRITE)); + + // reinstate read permission + sansView.setPermissions(Set.of(PosixFilePermission.OWNER_READ, + PosixFilePermission.OWNER_WRITE)); + + // lien -> realDir/a/b/c + Path lien = realDir.resolve(Path.of("a", "lien")); + Files.createSymbolicLink(lien, + realDir.resolve(Path.of("a", "b", "c"))); + + // lien/d/FUBAR + Path withLinks = lien.resolve(Path.of("d"), + sansLinks.getFileName()); + + PosixFileAttributeView withView = + Files.getFileAttributeView(withLinks, + PosixFileAttributeView.class, + LinkOption.NOFOLLOW_LINKS); + withView.setPermissions(Set.of(PosixFilePermission.OWNER_WRITE)); + withView.setPermissions(Set.of(PosixFilePermission.OWNER_WRITE)); } System.out.println("OKAY"); From f143380d013b8c0e5ab7ca0026c34e27e7946f69 Mon Sep 17 00:00:00 2001 From: Ben Perez Date: Wed, 16 Aug 2023 19:56:13 +0000 Subject: [PATCH 081/162] 8314240: test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java fails to compile Reviewed-by: mullan --- test/jdk/ProblemList.txt | 1 - test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 2de1708174e..24655fcb8c0 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -607,7 +607,6 @@ sun/security/pkcs11/rsa/TestSignatures.java 8295343 linux-al sun/security/pkcs11/rsa/TestKeyPairGenerator.java 8295343 linux-all sun/security/pkcs11/rsa/TestKeyFactory.java 8295343 linux-all sun/security/pkcs11/KeyStore/Basic.java 8295343 linux-all -sun/security/pkcs/pkcs7/SignerOrder.java 8314240 generic-all ############################################################################ diff --git a/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java b/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java index 705ad88c131..30f9392cfde 100644 --- a/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java +++ b/test/jdk/sun/security/pkcs/pkcs7/SignerOrder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,10 +102,10 @@ public static void main(String[] argv) throws Exception { printSignerInfos(pkcs72.getSignerInfos()); System.out.println("Verified signers of original:"); - SignerInfo[] verifs1 = pkcs71.verify(); + SignerInfo[] verifs1 = pkcs71.verify(null); System.out.println("Verified signers of after read-in:"); - SignerInfo[] verifs2 = pkcs72.verify(); + SignerInfo[] verifs2 = pkcs72.verify(null); if (verifs1.length != verifs2.length) { throw new RuntimeException("Length or Original vs read-in " From 0c3bc71d24fa13a0b1e55541c01554cd5e124027 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Wed, 16 Aug 2023 20:31:51 +0000 Subject: [PATCH 082/162] 8281169: Expand discussion of elements and types Reviewed-by: mcimadamore, prappo --- .../lang/model/element/package-info.java | 3 +- .../javax/lang/model/package-info.java | 87 ++++++++++++++++++- .../javax/lang/model/type/package-info.java | 3 +- 3 files changed, 89 insertions(+), 4 deletions(-) diff --git a/src/java.compiler/share/classes/javax/lang/model/element/package-info.java b/src/java.compiler/share/classes/javax/lang/model/element/package-info.java index 6e9b92bb806..1c3bc9292e1 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/package-info.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,6 +110,7 @@ * a {@code NullPointerException} if given a {@code null} argument. * * @see javax.lang.model.util.Elements + * @see javax.lang.model##elementsAndTypes Elements and Types * @see * JSR 269: Pluggable Annotation Processing API * @jls 6.1 Declarations diff --git a/src/java.compiler/share/classes/javax/lang/model/package-info.java b/src/java.compiler/share/classes/javax/lang/model/package-info.java index 44a31977bd0..5377b48065d 100644 --- a/src/java.compiler/share/classes/javax/lang/model/package-info.java +++ b/src/java.compiler/share/classes/javax/lang/model/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ /** * Types and hierarchies of packages comprising a {@index "Java language - * model"}, a model of the declarations and types of the Java + * model"}, a reflective API that models the declarations and types of the Java * programming language. * * The members of this package and its subpackages are for use in @@ -52,6 +52,89 @@ *

    Unless otherwise specified, methods in this package will throw * a {@code NullPointerException} if given a {@code null} argument. * + *

    Elements and Types

    + * + *

    Definitions and Uses

    + * + * In broad terms the {@link javax.lang.model.element element} package + * models the declarations, that is the definitions, of elements while + * the {@link javax.lang.model.type type} package models uses + * of types. In general, distinct uses can have individualized + * information separate from the information associated with the + * definition. In some sense, the information in the definition is + * shared by all the uses. + + *

    For example, consider the uses of {@code + * java.lang.String} in the string processing method {@code + * identityOrEmpty} below: + * + * {@snippet lang=java : + * // Return the argument if it is non-null and the empty string otherwise. + * public static @DefinitelyNotNull String identityOrEmpty(@MightBeNull String argument) { + * ... + * } + * } + * + * The return type of the method is a {@code String} annotated with + * a {@code @DefinitelyNotNull} type annotation while the type of + * the parameter is a {@code String} annotated with a {@code + * @MightBeNull} type annotation. In a reflective API, since the set + * of annotations is different for the two uses of {@code + * String} as a type, the return type and argument type would need to + * be represented by different objects to distinguish between these two + * cases. The definition of {@code java.lang.String} itself + * is annotated with neither of the type annotations in question. + * + *

    Another example, consider the declaration of the generic + * interface (JLS {@jls 9.1.2}) {@code java.util.Set} which has one + * type parameter. This declaration captures commonality between the + * many parameterized types (JLS {@jls 4.5}) derived from that + * declaration such as {@code java.util.Set}, {@code + * java.util.Set}, {@code java.util.Set}, and also the raw type + * (JLS {@jls 4.8}) {@code java.util.Set}. + * + *

    Mapping between Elements and Types

    + * + * While distinct concepts, there are bidirectional (partial) mappings + * between elements and types, between definitions and uses. For + * example, roughly speaking, information that would be invariant for + * all uses of a type can be retrieved from the element defining a + * type. For example, consider a {@link + * javax.lang.model.type.DeclaredType DeclaredType} type mirror + * modeling a use of {@code java.lang.String}. Calling {@link + * javax.lang.model.type.DeclaredType#asElement()} would return the + * {@link javax.lang.model.element.TypeElement} for {@code + * java.lang.String}. From the {@code TypeElement}, common information + * such as {@linkplain + * javax.lang.model.element.TypeElement#getSimpleName() name} and + * {@linkplain javax.lang.model.element.TypeElement#getModifiers() + * modifiers} can be retrieved. + * + *

    All elements can be {@linkplain + * javax.lang.model.element.Element#asType() mapped to} some type. + * The elements for classes and interfaces get {@linkplain + * javax.lang.model.element.TypeElement#asType() mapped to} a + * prototypical type. (If a class or interface is generic, its + * prototypical type mirror is parameterized with type arguments + * matching the type variables of the declaration, all + * unannotated. Otherwise, for a non-generic class or interface, the + * prototypical type mirror corresponds to an unannotated use of the + * type.) Conversely, in general, many types can map to the same + * {@linkplain javax.lang.model.element.TypeElement type element}. For + * example, the type mirror for the raw type {@code java.util.Set}, + * the prototypical type {@code java.util.Set}, and the type {@code + * java.util.Set} would all {@linkplain + * javax.lang.model.type.DeclaredType#asElement() map to} the type + * element for {@code java.util.Set}. Several kinds of types can be + * mapped to elements, but other kinds of types do not have + * an {@linkplain javax.lang.model.util.Types#asElement(TypeMirror) + * element mapping}. For example, the type mirror of an {@linkplain + * javax.lang.model.type.ExecutableType executable type} does + * not have an element mapping while a {@linkplain + * javax.lang.model.type.DeclaredType declared type} would map to a + * {@linkplain javax.lang.model.element.TypeElement type element}, as + * discussed above. + * * @since 1.6 * * @see diff --git a/src/java.compiler/share/classes/javax/lang/model/type/package-info.java b/src/java.compiler/share/classes/javax/lang/model/type/package-info.java index 712cfe0f217..945ada68284 100644 --- a/src/java.compiler/share/classes/javax/lang/model/type/package-info.java +++ b/src/java.compiler/share/classes/javax/lang/model/type/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ * a {@code NullPointerException} if given a {@code null} argument. * * @see javax.lang.model.util.Types + * @see javax.lang.model##elementsAndTypes Elements and Types * @see * JSR 269: Pluggable Annotation Processing API * @jls 4.1 The Kinds of Types and Values From 2a1176b544d030c09edaf95cb67f69b442aa465d Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Thu, 17 Aug 2023 05:06:11 +0000 Subject: [PATCH 083/162] 8314276: Improve PtrQueue API around size/capacity Reviewed-by: iwalulya, tschatzl --- .../share/gc/g1/g1CardTableEntryClosure.hpp | 5 +- src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp | 31 ++++------ .../share/gc/g1/g1RedirtyCardsQueue.cpp | 4 +- src/hotspot/share/gc/g1/g1RemSet.cpp | 3 +- .../gc/g1/g1YoungGCPostEvacuateTasks.cpp | 3 +- .../share/gc/g1/g1YoungGCPreEvacuateTasks.cpp | 6 +- src/hotspot/share/gc/g1/g1_globals.hpp | 4 +- .../share/gc/g1/jvmFlagConstraintsG1.cpp | 30 +++++++++ .../share/gc/g1/jvmFlagConstraintsG1.hpp | 7 ++- src/hotspot/share/gc/shared/ptrQueue.cpp | 38 ++++++++---- src/hotspot/share/gc/shared/ptrQueue.hpp | 62 ++++++++++++------- src/hotspot/share/gc/shared/satbMarkQueue.cpp | 22 +++---- src/hotspot/share/gc/shared/satbMarkQueue.hpp | 6 +- 13 files changed, 138 insertions(+), 83 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardTableEntryClosure.hpp b/src/hotspot/share/gc/g1/g1CardTableEntryClosure.hpp index 76e795b880c..660ccbf1c0f 100644 --- a/src/hotspot/share/gc/g1/g1CardTableEntryClosure.hpp +++ b/src/hotspot/share/gc/g1/g1CardTableEntryClosure.hpp @@ -39,9 +39,10 @@ class G1CardTableEntryClosure: public CHeapObj { virtual void do_card_ptr(CardValue* card_ptr, uint worker_id) = 0; // Process all the card_ptrs in node. - void apply_to_buffer(BufferNode* node, size_t buffer_capacity, uint worker_id) { + void apply_to_buffer(BufferNode* node, uint worker_id) { void** buffer = BufferNode::make_buffer_from_node(node); - for (size_t i = node->index(); i < buffer_capacity; ++i) { + size_t capacity = node->capacity(); + for (size_t i = node->index(); i < capacity; ++i) { CardValue* card_ptr = static_cast(buffer[i]); do_card_ptr(card_ptr, worker_id); } diff --git a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp index 2d1d0f5490a..e34927c0b0a 100644 --- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp +++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp @@ -86,7 +86,7 @@ uint G1DirtyCardQueueSet::num_par_ids() { void G1DirtyCardQueueSet::flush_queue(G1DirtyCardQueue& queue) { if (queue.buffer() != nullptr) { G1ConcurrentRefineStats* stats = queue.refinement_stats(); - stats->inc_dirtied_cards(buffer_capacity() - queue.index()); + stats->inc_dirtied_cards(queue.size()); } PtrQueueSet::flush_queue(queue); } @@ -104,8 +104,9 @@ void G1DirtyCardQueueSet::handle_zero_index(G1DirtyCardQueue& queue) { assert(queue.index() == 0, "precondition"); BufferNode* old_node = exchange_buffer_with_new(queue); if (old_node != nullptr) { + assert(old_node->index() == 0, "invariant"); G1ConcurrentRefineStats* stats = queue.refinement_stats(); - stats->inc_dirtied_cards(buffer_capacity()); + stats->inc_dirtied_cards(old_node->capacity()); handle_completed_buffer(old_node, stats); } } @@ -123,7 +124,7 @@ void G1DirtyCardQueueSet::enqueue_completed_buffer(BufferNode* cbn) { assert(cbn != nullptr, "precondition"); // Increment _num_cards before adding to queue, so queue removal doesn't // need to deal with _num_cards possibly going negative. - Atomic::add(&_num_cards, buffer_capacity() - cbn->index()); + Atomic::add(&_num_cards, cbn->size()); // Perform push in CS. The old tail may be popped while the push is // observing it (attaching it to the new buffer). We need to ensure it // can't be reused until the push completes, to avoid ABA problems. @@ -159,7 +160,7 @@ BufferNode* G1DirtyCardQueueSet::get_completed_buffer() { result = dequeue_completed_buffer(); if (result == nullptr) return nullptr; } - Atomic::sub(&_num_cards, buffer_capacity() - result->index()); + Atomic::sub(&_num_cards, result->size()); return result; } @@ -169,7 +170,7 @@ void G1DirtyCardQueueSet::verify_num_cards() const { for (BufferNode* cur = _completed.first(); !_completed.is_end(cur); cur = cur->next()) { - actual += buffer_capacity() - cur->index(); + actual += cur->size(); } assert(actual == Atomic::load(&_num_cards), "Num entries in completed buffers should be " SIZE_FORMAT " but are " SIZE_FORMAT, @@ -285,7 +286,7 @@ void G1DirtyCardQueueSet::record_paused_buffer(BufferNode* node) { // notification checking after the coming safepoint if it doesn't GC. // Note that this means the queue's _num_cards differs from the number // of cards in the queued buffers when there are paused buffers. - Atomic::add(&_num_cards, buffer_capacity() - node->index()); + Atomic::add(&_num_cards, node->size()); _paused.add(node); } @@ -422,12 +423,11 @@ class G1RefineBufferedCards : public StackObj { public: G1RefineBufferedCards(BufferNode* node, - size_t node_buffer_capacity, uint worker_id, G1ConcurrentRefineStats* stats) : _node(node), _node_buffer(reinterpret_cast(BufferNode::make_buffer_from_node(node))), - _node_buffer_capacity(node_buffer_capacity), + _node_buffer_capacity(node->capacity()), _worker_id(worker_id), _stats(stats), _g1rs(G1CollectedHeap::heap()->rem_set()) {} @@ -456,10 +456,7 @@ bool G1DirtyCardQueueSet::refine_buffer(BufferNode* node, uint worker_id, G1ConcurrentRefineStats* stats) { Ticks start_time = Ticks::now(); - G1RefineBufferedCards buffered_cards(node, - buffer_capacity(), - worker_id, - stats); + G1RefineBufferedCards buffered_cards(node, worker_id, stats); bool result = buffered_cards.refine(); stats->inc_refinement_time(Ticks::now() - start_time); return result; @@ -468,12 +465,11 @@ bool G1DirtyCardQueueSet::refine_buffer(BufferNode* node, void G1DirtyCardQueueSet::handle_refined_buffer(BufferNode* node, bool fully_processed) { if (fully_processed) { - assert(node->index() == buffer_capacity(), - "Buffer not fully consumed: index: " SIZE_FORMAT ", size: " SIZE_FORMAT, - node->index(), buffer_capacity()); + assert(node->is_empty(), "Buffer not fully consumed: index: %zu, size: %zu", + node->index(), node->capacity()); deallocate_buffer(node); } else { - assert(node->index() < buffer_capacity(), "Buffer fully consumed."); + assert(!node->is_empty(), "Buffer fully consumed."); // Buffer incompletely processed because there is a pending safepoint. // Record partially processed buffer, to be finished later. record_paused_buffer(node); @@ -575,8 +571,7 @@ G1ConcurrentRefineStats G1DirtyCardQueueSet::concatenate_log_and_stats(Thread* t G1DirtyCardQueue& queue = G1ThreadLocalData::dirty_card_queue(thread); // Flush the buffer if non-empty. Flush before accumulating and // resetting stats, since flushing may modify the stats. - if ((queue.buffer() != nullptr) && - (queue.index() != buffer_capacity())) { + if (!queue.is_empty()) { flush_queue(queue); } diff --git a/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp b/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp index 70d0084d7b2..216024615e2 100644 --- a/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp +++ b/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp @@ -46,7 +46,7 @@ G1RedirtyCardsLocalQueueSet::~G1RedirtyCardsLocalQueueSet() { #endif // ASSERT void G1RedirtyCardsLocalQueueSet::enqueue_completed_buffer(BufferNode* node) { - _buffers._entry_count += buffer_capacity() - node->index(); + _buffers._entry_count += node->size(); node->set_next(_buffers._head); _buffers._head = node; if (_buffers._tail == nullptr) { @@ -130,7 +130,7 @@ void G1RedirtyCardsQueueSet::update_tail(BufferNode* node) { void G1RedirtyCardsQueueSet::enqueue_completed_buffer(BufferNode* node) { assert(_collecting, "precondition"); - Atomic::add(&_entry_count, buffer_capacity() - node->index()); + Atomic::add(&_entry_count, node->size()); _list.push(*node); update_tail(node); } diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp index d17e6fdd46d..07acd9dd5b5 100644 --- a/src/hotspot/share/gc/g1/g1RemSet.cpp +++ b/src/hotspot/share/gc/g1/g1RemSet.cpp @@ -1264,9 +1264,8 @@ class G1MergeHeapRootsTask : public WorkerTask { void apply_closure_to_dirty_card_buffers(G1MergeLogBufferCardsClosure* cl, uint worker_id) { G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set(); - size_t buffer_capacity = dcqs.buffer_capacity(); while (BufferNode* node = _dirty_card_buffers.pop()) { - cl->apply_to_buffer(node, buffer_capacity, worker_id); + cl->apply_to_buffer(node, worker_id); dcqs.deallocate_buffer(node); } } diff --git a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp index b0231f4d29e..798e6f3c604 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp @@ -414,13 +414,12 @@ class G1PostEvacuateCollectionSetCleanupTask2::RedirtyLoggedCardsTask : public G void do_work(uint worker_id) override { RedirtyLoggedCardTableEntryClosure cl(G1CollectedHeap::heap(), _evac_failure_regions); - const size_t buffer_capacity = _rdcqs->buffer_capacity(); BufferNode* next = Atomic::load(&_nodes); while (next != nullptr) { BufferNode* node = next; next = Atomic::cmpxchg(&_nodes, node, node->next()); if (next == node) { - cl.apply_to_buffer(node, buffer_capacity, worker_id); + cl.apply_to_buffer(node, worker_id); next = node->next(); } } diff --git a/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp index 7e6dd42e97e..d3a6436e432 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp @@ -167,12 +167,10 @@ static void verify_empty_dirty_card_logs() { ResourceMark rm; struct Verifier : public ThreadClosure { - size_t _buffer_capacity; - Verifier() : _buffer_capacity(G1BarrierSet::dirty_card_queue_set().buffer_capacity()) {} + Verifier() {} void do_thread(Thread* t) override { G1DirtyCardQueue& queue = G1ThreadLocalData::dirty_card_queue(t); - assert((queue.buffer() == nullptr) || (queue.index() == _buffer_capacity), - "non-empty dirty card queue for thread %s", t->name()); + assert(queue.is_empty(), "non-empty dirty card queue for thread %s", t->name()); } } verifier; Threads::threads_do(&verifier); diff --git a/src/hotspot/share/gc/g1/g1_globals.hpp b/src/hotspot/share/gc/g1/g1_globals.hpp index c9f07503242..e4b6f259e49 100644 --- a/src/hotspot/share/gc/g1/g1_globals.hpp +++ b/src/hotspot/share/gc/g1/g1_globals.hpp @@ -146,7 +146,7 @@ \ product(size_t, G1SATBBufferSize, 1*K, \ "Number of entries in an SATB log buffer.") \ - range(1, max_uintx) \ + constraint(G1SATBBufferSizeConstraintFunc, AtParse) \ \ develop(intx, G1SATBProcessCompletedThreshold, 20, \ "Number of completed buffers that triggers log processing.") \ @@ -166,7 +166,7 @@ \ product(size_t, G1UpdateBufferSize, 256, \ "Size of an update buffer") \ - range(1, NOT_LP64(32*M) LP64_ONLY(1*G)) \ + constraint(G1UpdateBufferSizeConstraintFunc, AtParse) \ \ product(intx, G1RSetUpdatingPauseTimePercent, 10, \ "A target percentage of time that is allowed to be spend on " \ diff --git a/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp b/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp index 889af717deb..88b5b204f5a 100644 --- a/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp +++ b/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/g1/heapRegionBounds.inline.hpp" #include "gc/g1/jvmFlagConstraintsG1.hpp" +#include "gc/shared/ptrQueue.hpp" #include "runtime/globals_extension.hpp" #include "utilities/globalDefinitions.hpp" @@ -180,3 +181,32 @@ JVMFlag::Error NewSizeConstraintFuncG1(size_t value, bool verbose) { size_t MaxSizeForHeapAlignmentG1() { return HeapRegionBounds::max_size(); } + +static JVMFlag::Error buffer_size_constraint_helper(JVMFlagsEnum flagid, + size_t value, + bool verbose) { + if (UseG1GC) { + const size_t min_size = 1; + const size_t max_size = BufferNode::max_size(); + JVMFlag* flag = JVMFlag::flag_from_enum(flagid); + if ((value < min_size) || (value > max_size)) { + JVMFlag::printError(verbose, + "%s (%zu) must be in range [%zu, %zu]\n", + flag->name(), value, min_size, max_size); + return JVMFlag::OUT_OF_BOUNDS; + } + } + return JVMFlag::SUCCESS; +} + +JVMFlag::Error G1SATBBufferSizeConstraintFunc(size_t value, bool verbose) { + return buffer_size_constraint_helper(FLAG_MEMBER_ENUM(G1SATBBufferSize), + value, + verbose); +} + +JVMFlag::Error G1UpdateBufferSizeConstraintFunc(size_t value, bool verbose) { + return buffer_size_constraint_helper(FLAG_MEMBER_ENUM(G1UpdateBufferSize), + value, + verbose); +} diff --git a/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.hpp b/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.hpp index d0de64ac561..a424a58b560 100644 --- a/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.hpp +++ b/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.hpp @@ -43,7 +43,12 @@ /* G1 Subconstraints */ \ f(uintx, MaxGCPauseMillisConstraintFuncG1) \ f(uintx, GCPauseIntervalMillisConstraintFuncG1) \ - f(size_t, NewSizeConstraintFuncG1) + f(size_t, NewSizeConstraintFuncG1) \ + \ + /* G1 PtrQueue buffer size constraints */ \ + f(size_t, G1SATBBufferSizeConstraintFunc) \ + f(size_t, G1UpdateBufferSizeConstraintFunc) \ + /* */ G1_GC_CONSTRAINTS(DECLARE_CONSTRAINT) diff --git a/src/hotspot/share/gc/shared/ptrQueue.cpp b/src/hotspot/share/gc/shared/ptrQueue.cpp index b267cc818fc..20cc1b944ea 100644 --- a/src/hotspot/share/gc/shared/ptrQueue.cpp +++ b/src/hotspot/share/gc/shared/ptrQueue.cpp @@ -30,7 +30,6 @@ PtrQueue::PtrQueue(PtrQueueSet* qset) : _index(0), - _capacity_in_bytes(index_to_byte_index(qset->buffer_capacity())), _buf(nullptr) {} @@ -38,10 +37,23 @@ PtrQueue::~PtrQueue() { assert(_buf == nullptr, "queue must be flushed before delete"); } -BufferNode::AllocatorConfig::AllocatorConfig(size_t size) : _buffer_capacity(size) {} +size_t PtrQueue::current_capacity() const { + if (_buf == nullptr) { + return 0; + } else { + return BufferNode::make_node_from_buffer(_buf)->capacity(); + } +} + +BufferNode::AllocatorConfig::AllocatorConfig(size_t size) + : _buffer_capacity(size) +{ + assert(size >= 1, "Invalid buffer capacity %zu", size); + assert(size <= max_size(), "Invalid buffer capacity %zu", size); +} void* BufferNode::AllocatorConfig::allocate() { - size_t byte_size = _buffer_capacity * sizeof(void*); + size_t byte_size = buffer_capacity() * sizeof(void*); return NEW_C_HEAP_ARRAY(char, buffer_offset() + byte_size, mtGC); } @@ -53,21 +65,22 @@ void BufferNode::AllocatorConfig::deallocate(void* node) { BufferNode::Allocator::Allocator(const char* name, size_t buffer_capacity) : _config(buffer_capacity), _free_list(name, &_config) -{ - -} +{} size_t BufferNode::Allocator::free_count() const { return _free_list.free_count(); } BufferNode* BufferNode::Allocator::allocate() { - return ::new (_free_list.allocate()) BufferNode(); + auto internal_capacity = static_cast(buffer_capacity()); + return ::new (_free_list.allocate()) BufferNode(internal_capacity); } void BufferNode::Allocator::release(BufferNode* node) { assert(node != nullptr, "precondition"); assert(node->next() == nullptr, "precondition"); + assert(node->capacity() == buffer_capacity(), + "Wrong size %zu, expected %zu", node->capacity(), buffer_capacity()); node->~BufferNode(); _free_list.release(node); } @@ -79,9 +92,7 @@ PtrQueueSet::PtrQueueSet(BufferNode::Allocator* allocator) : PtrQueueSet::~PtrQueueSet() {} void PtrQueueSet::reset_queue(PtrQueue& queue) { - if (queue.buffer() != nullptr) { - queue.set_index(buffer_capacity()); - } + queue.set_index(queue.current_capacity()); } void PtrQueueSet::flush_queue(PtrQueue& queue) { @@ -91,7 +102,7 @@ void PtrQueueSet::flush_queue(PtrQueue& queue) { queue.set_buffer(nullptr); queue.set_index(0); BufferNode* node = BufferNode::make_node_from_buffer(buffer, index); - if (index == buffer_capacity()) { + if (index == node->capacity()) { deallocate_buffer(node); } else { enqueue_completed_buffer(node); @@ -128,8 +139,9 @@ BufferNode* PtrQueueSet::exchange_buffer_with_new(PtrQueue& queue) { } void PtrQueueSet::install_new_buffer(PtrQueue& queue) { - queue.set_buffer(allocate_buffer()); - queue.set_index(buffer_capacity()); + BufferNode* node = _allocator->allocate(); + queue.set_buffer(BufferNode::make_buffer_from_node(node)); + queue.set_index(node->capacity()); } void** PtrQueueSet::allocate_buffer() { diff --git a/src/hotspot/share/gc/shared/ptrQueue.hpp b/src/hotspot/share/gc/shared/ptrQueue.hpp index 81969d078df..69a12c547f5 100644 --- a/src/hotspot/share/gc/shared/ptrQueue.hpp +++ b/src/hotspot/share/gc/shared/ptrQueue.hpp @@ -32,6 +32,7 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/lockFreeStack.hpp" #include "utilities/sizes.hpp" +#include // There are various techniques that require threads to be able to log // addresses. For example, a generational write barrier might log @@ -50,18 +51,8 @@ class PtrQueue { // Value is always pointer-size aligned. size_t _index; - // Size of the current buffer, in bytes. - // Value is always pointer-size aligned. - size_t _capacity_in_bytes; - static const size_t _element_size = sizeof(void*); - // Get the capacity, in bytes. The capacity must have been set. - size_t capacity_in_bytes() const { - assert(_capacity_in_bytes > 0, "capacity not set"); - return _capacity_in_bytes; - } - static size_t byte_index_to_index(size_t ind) { assert(is_aligned(ind, _element_size), "precondition"); return ind / _element_size; @@ -92,17 +83,19 @@ class PtrQueue { } void set_index(size_t new_index) { - assert(new_index <= capacity(), "precondition"); + assert(new_index <= current_capacity(), "precondition"); _index = index_to_byte_index(new_index); } - size_t capacity() const { - return byte_index_to_index(capacity_in_bytes()); - } + // Returns the capacity of the buffer, or 0 if the queue doesn't currently + // have a buffer. + size_t current_capacity() const; - // To support compiler. + bool is_empty() const { return index() == current_capacity(); } + size_t size() const { return current_capacity() - index(); } protected: + // To support compiler. template static ByteSize byte_offset_of_index() { return byte_offset_of(Derived, _index); @@ -119,12 +112,19 @@ class PtrQueue { }; class BufferNode { - size_t _index; + using InternalSizeType = LP64_ONLY(uint32_t) NOT_LP64(uint16_t); + static_assert(sizeof(InternalSizeType) <= sizeof(size_t), "assumption"); + + InternalSizeType _index; + InternalSizeType _capacity; BufferNode* volatile _next; void* _buffer[1]; // Pseudo flexible array member. - BufferNode() : _index(0), _next(nullptr) { } - ~BufferNode() { } + BufferNode(InternalSizeType capacity) + : _index(capacity), _capacity(capacity), _next(nullptr) + {} + + ~BufferNode() = default; NONCOPYABLE(BufferNode); @@ -133,19 +133,36 @@ class BufferNode { } public: + static constexpr size_t max_size() { + return std::numeric_limits::max(); + } + static BufferNode* volatile* next_ptr(BufferNode& bn) { return &bn._next; } typedef LockFreeStack Stack; BufferNode* next() const { return _next; } void set_next(BufferNode* n) { _next = n; } size_t index() const { return _index; } - void set_index(size_t i) { _index = i; } + + void set_index(size_t i) { + assert(i <= capacity(), "precondition"); + _index = static_cast(i); + } + + size_t capacity() const { return _capacity; } + + bool is_empty() const { return index() == capacity(); } + size_t size() const { return capacity() - index(); } + + // Return the BufferNode containing the buffer, WITHOUT setting its index. + static BufferNode* make_node_from_buffer(void** buffer) { + char* base = reinterpret_cast(buffer) - buffer_offset(); + return reinterpret_cast(base); + } // Return the BufferNode containing the buffer, after setting its index. static BufferNode* make_node_from_buffer(void** buffer, size_t index) { - BufferNode* node = - reinterpret_cast( - reinterpret_cast(buffer) - buffer_offset()); + BufferNode* node = make_node_from_buffer(buffer); node->set_index(index); return node; } @@ -166,6 +183,7 @@ class BufferNode { // FreeListAllocator. class BufferNode::AllocatorConfig : public FreeListConfig { const size_t _buffer_capacity; + public: explicit AllocatorConfig(size_t size); diff --git a/src/hotspot/share/gc/shared/satbMarkQueue.cpp b/src/hotspot/share/gc/shared/satbMarkQueue.cpp index 051e6fa9e44..a0efcc8e66a 100644 --- a/src/hotspot/share/gc/shared/satbMarkQueue.cpp +++ b/src/hotspot/share/gc/shared/satbMarkQueue.cpp @@ -60,7 +60,7 @@ static void print_satb_buffer(const char* name, } void SATBMarkQueue::print(const char* name) { - print_satb_buffer(name, _buf, index(), capacity()); + print_satb_buffer(name, _buf, index(), current_capacity()); } #endif // PRODUCT @@ -193,10 +193,10 @@ void SATBMarkQueueSet::set_active_all_threads(bool active, bool expected_active) _qset(qset), _active(active) {} virtual void do_thread(Thread* t) { SATBMarkQueue& queue = _qset->satb_queue_for_thread(t); - if (queue.buffer() != nullptr) { - assert(!_active || queue.index() == _qset->buffer_capacity(), - "queues should be empty when activated"); - queue.set_index(_qset->buffer_capacity()); + if (_active) { + assert(queue.is_empty(), "queues should be empty when activated"); + } else { + queue.set_index(queue.current_capacity()); } queue.set_active(_active); } @@ -208,10 +208,7 @@ bool SATBMarkQueueSet::apply_closure_to_completed_buffer(SATBBufferClosure* cl) BufferNode* nd = get_completed_buffer(); if (nd != nullptr) { void **buf = BufferNode::make_buffer_from_node(nd); - size_t index = nd->index(); - size_t size = buffer_capacity(); - assert(index <= size, "invariant"); - cl->do_buffer(buf + index, size - index); + cl->do_buffer(buf + nd->index(), nd->size()); deallocate_buffer(nd); return true; } else { @@ -250,14 +247,15 @@ void SATBMarkQueueSet::handle_zero_index(SATBMarkQueue& queue) { } bool SATBMarkQueueSet::should_enqueue_buffer(SATBMarkQueue& queue) { + assert(queue.buffer() != nullptr, "precondition"); // Keep the current buffer if filtered index >= threshold. size_t threshold = buffer_enqueue_threshold(); // Ensure we'll enqueue completely full buffers. assert(threshold > 0, "enqueue threshold = 0"); // Ensure we won't enqueue empty buffers. - assert(threshold <= buffer_capacity(), + assert(threshold <= queue.current_capacity(), "enqueue threshold %zu exceeds capacity %zu", - threshold, buffer_capacity()); + threshold, queue.current_capacity()); return queue.index() < threshold; } @@ -310,7 +308,7 @@ void SATBMarkQueueSet::print_all(const char* msg) { while (nd != nullptr) { void** buf = BufferNode::make_buffer_from_node(nd); os::snprintf(buffer, SATB_PRINTER_BUFFER_SIZE, "Enqueued: %d", i); - print_satb_buffer(buffer, buf, nd->index(), buffer_capacity()); + print_satb_buffer(buffer, buf, nd->index(), nd->capacity()); nd = nd->next(); i += 1; } diff --git a/src/hotspot/share/gc/shared/satbMarkQueue.hpp b/src/hotspot/share/gc/shared/satbMarkQueue.hpp index 0e89220ccda..d92523d7e4f 100644 --- a/src/hotspot/share/gc/shared/satbMarkQueue.hpp +++ b/src/hotspot/share/gc/shared/satbMarkQueue.hpp @@ -175,13 +175,13 @@ inline void SATBMarkQueueSet::apply_filter(Filter filter_out, SATBMarkQueue& que void** buf = queue.buffer(); if (buf == nullptr) { - // nothing to do + // Nothing to do, and avoid pointer arithmetic on nullptr below. return; } // Two-fingered compaction toward the end. - void** src = &buf[queue.index()]; - void** dst = &buf[buffer_capacity()]; + void** src = buf + queue.index(); + void** dst = buf + queue.current_capacity(); assert(src <= dst, "invariant"); for ( ; src < dst; ++src) { // Search low to high for an entry to keep. From b78f5a1068224d8b3cfe9e8fb38307ca07de741d Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Thu, 17 Aug 2023 05:33:44 +0000 Subject: [PATCH 084/162] 8314076: ICC_ColorSpace#minVal/maxVal have the opposite description Reviewed-by: azvegint --- .../share/classes/java/awt/color/ICC_ColorSpace.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java b/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java index 7a73cc86c9c..a20eca94a3f 100644 --- a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java +++ b/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java @@ -93,12 +93,12 @@ public class ICC_ColorSpace extends ColorSpace { private ICC_Profile thisProfile; /** - * The maximum normalized component values. + * The minimum normalized component values. */ private float[] minVal; /** - * The minimum normalized component values. + * The maximum normalized component values. */ private float[] maxVal; From 249dc37426d6eb5b70a387317b6780b643ce4c06 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Thu, 17 Aug 2023 07:13:38 +0000 Subject: [PATCH 085/162] 8314321: Remove unused field jdk.internal.util.xml.impl.Attrs.mAttrIdx Reviewed-by: alanb, vtewari, bpb --- .../classes/jdk/internal/util/xml/impl/Attrs.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/util/xml/impl/Attrs.java b/src/java.base/share/classes/jdk/internal/util/xml/impl/Attrs.java index 55fc7e165f4..15cbf1c6dce 100644 --- a/src/java.base/share/classes/jdk/internal/util/xml/impl/Attrs.java +++ b/src/java.base/share/classes/jdk/internal/util/xml/impl/Attrs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,16 +41,12 @@ public class Attrs implements Attributes { * Number of attributes in the attributes string array. */ private char mLength; - /** - * current index - */ - private char mAttrIdx = 0; /** * Constructor. */ public Attrs() { - // The default number of attributies capacity is 8. + // The default number of attributes capacity is 8. mItems = new String[(8 << 3)]; } @@ -136,7 +132,7 @@ public String getQName(int index) { * *

    If the parser has not read a declaration for the attribute, or if the * parser does not report attribute types, then it must return the value - * "CDATA" as stated in the XML 1.0 Recommentation (clause 3.3.3, + * "CDATA" as stated in the XML 1.0 Recommendation (clause 3.3.3, * "Attribute-Value Normalization").

    * *

    For an enumerated attribute that is not a notation, the parser will From 43311930107d1783b742adbe567e9bdbcb55775d Mon Sep 17 00:00:00 2001 From: Aggelos Biboudis Date: Thu, 17 Aug 2023 07:33:16 +0000 Subject: [PATCH 086/162] 8314423: Multiple patterns without unnamed variables 8314216: Case enumConstant, pattern compilation fails Reviewed-by: jlahoda --- .../com/sun/tools/javac/comp/Check.java | 13 +++++++++++ .../sun/tools/javac/parser/JavacParser.java | 2 ++ test/langtools/tools/javac/T8314216.java | 18 +++++++++++++++ test/langtools/tools/javac/T8314216.out | 5 ++++ test/langtools/tools/javac/T8314423.java | 23 +++++++++++++++++++ test/langtools/tools/javac/T8314423.out | 2 ++ 6 files changed, 63 insertions(+) create mode 100644 test/langtools/tools/javac/T8314216.java create mode 100644 test/langtools/tools/javac/T8314216.out create mode 100644 test/langtools/tools/javac/T8314423.java create mode 100644 test/langtools/tools/javac/T8314423.out diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java index 06d39392938..b60694744a1 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java @@ -4609,6 +4609,19 @@ void checkSwitchCaseStructure(List cases) { if (!allUnderscore) { log.error(c.labels.tail.head.pos(), Errors.FlowsThroughFromPattern); } + + boolean allPatternCaseLabels = c.labels.stream().allMatch(p -> p instanceof JCPatternCaseLabel); + + if (allPatternCaseLabels) { + preview.checkSourceLevel(c.labels.tail.head.pos(), Feature.UNNAMED_VARIABLES); + } + + for (JCCaseLabel label : c.labels.tail) { + if (label instanceof JCConstantCaseLabel) { + log.error(label.pos(), Errors.InvalidCaseLabelCombination); + break; + } + } } } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java index 7780321e7a7..f6368c48b08 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -3310,6 +3310,8 @@ PatternResult analyzePattern(int lookahead) { } else { pendingResult = PatternResult.PATTERN; } + } else if (typeDepth == 0 && parenDepth == 0 && (peekToken(lookahead, tk -> tk == ARROW || tk == COMMA))) { + return PatternResult.EXPRESSION; } break; case UNDERSCORE: diff --git a/test/langtools/tools/javac/T8314216.java b/test/langtools/tools/javac/T8314216.java new file mode 100644 index 00000000000..c71aed3273a --- /dev/null +++ b/test/langtools/tools/javac/T8314216.java @@ -0,0 +1,18 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8314216 + * @summary Multiple patterns without unnamed variables + * @compile/fail/ref=T8314216.out -XDrawDiagnostics --enable-preview --source ${jdk.version} T8314216.java + */ + +public class T8314216 { + enum X {A, B} + + void test(Object obj) { + switch (obj) { + case X.A, Integer _ -> System.out.println("A or Integer"); + case String _, X.B -> System.out.println("B or String"); + default -> System.out.println("other"); + } + } +} diff --git a/test/langtools/tools/javac/T8314216.out b/test/langtools/tools/javac/T8314216.out new file mode 100644 index 00000000000..0dde8fbb11f --- /dev/null +++ b/test/langtools/tools/javac/T8314216.out @@ -0,0 +1,5 @@ +T8314216.java:13:23: compiler.err.invalid.case.label.combination +T8314216.java:14:28: compiler.err.invalid.case.label.combination +- compiler.note.preview.filename: T8314216.java, DEFAULT +- compiler.note.preview.recompile +2 errors \ No newline at end of file diff --git a/test/langtools/tools/javac/T8314423.java b/test/langtools/tools/javac/T8314423.java new file mode 100644 index 00000000000..43301682af8 --- /dev/null +++ b/test/langtools/tools/javac/T8314423.java @@ -0,0 +1,23 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8314423 + * @summary Multiple patterns without unnamed variables + * @compile/fail/ref=T8314423.out -XDrawDiagnostics T8314423.java + * @compile --enable-preview --source ${jdk.version} T8314423.java + */ + +public class T8314423 { + record R1() {} + record R2() {} + + static void test(Object obj) { + switch (obj) { + case R1(), R2() -> System.out.println("R1 or R2"); + default -> System.out.println("other"); + } + } + + public static void main(String[] args) { + test(new R1()); + } +} diff --git a/test/langtools/tools/javac/T8314423.out b/test/langtools/tools/javac/T8314423.out new file mode 100644 index 00000000000..ee23eecf224 --- /dev/null +++ b/test/langtools/tools/javac/T8314423.out @@ -0,0 +1,2 @@ +T8314423.java:15:24: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.unnamed.variables) +1 error \ No newline at end of file From 6f1071f5ed6bd552378b2b70cd685b74e7f9e43d Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Thu, 17 Aug 2023 07:43:07 +0000 Subject: [PATCH 087/162] 8314213: DocLint should warn about unknown standard tags Reviewed-by: jjg --- .../formats/html/taglets/TagletManager.java | 2 +- .../jdk/javadoc/internal/doclint/Checker.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletManager.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletManager.java index a4724f03e9d..392678be6d3 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletManager.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletManager.java @@ -358,7 +358,7 @@ public void checkTags(Element element, Iterable trees) { if (!name.isEmpty() && name.charAt(0) == '@') { name = name.substring(1); } - if (! (standardTags.contains(name) || allTaglets.containsKey(name))) { + if (! (standardTags.contains(name) || allTaglets.containsKey(name))) { // defunct, see 8314213 if (standardTagsLowercase.contains(Utils.toLowerCase(name))) { messages.warning(ch.getDocTreePath(tag), "doclet.UnknownTagLowercase", ch.getTagName(tag)); continue; diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java index 2a4b6332f60..2f5631adbc9 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java @@ -41,6 +41,8 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; @@ -1138,10 +1140,23 @@ public Void visitUnknownInlineTag(UnknownInlineTagTree tree, Void ignore) { } private void checkUnknownTag(DocTree tree, String tagName) { + // if it were a standard tag, this method wouldn't be called: + // a standard tag is never represented by Unknown{Block,Inline}TagTree + assert tree instanceof UnknownBlockTagTree + || tree instanceof UnknownInlineTagTree; + assert !getStandardTags().contains(tagName); + // report an unknown tag only if custom tags are set, see 8314213 if (env.customTags != null && !env.customTags.contains(tagName)) env.messages.error(SYNTAX, tree, "dc.tag.unknown", tagName); } + private Set getStandardTags() { + return Stream.of(DocTree.Kind.values()) + .filter(k -> k.tagName != null) // not all DocTree represent tags + .map(k -> k.tagName) + .collect(Collectors.toUnmodifiableSet()); + } + @Override @DefinedBy(Api.COMPILER_TREE) public Void visitUses(UsesTree tree, Void ignore) { Element e = env.trees.getElement(env.currPath); From ed585d16b9069a678bb8633239ca87f64c956fdd Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Thu, 17 Aug 2023 08:02:53 +0000 Subject: [PATCH 088/162] 8314280: StructuredTaskScope.shutdown should document that the state of completing subtasks is not defined Reviewed-by: psandoz --- .../classes/java/util/concurrent/StructuredTaskScope.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java b/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java index 4d9f8cb45b9..5440f2e747f 100644 --- a/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java +++ b/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java @@ -756,6 +756,12 @@ private boolean implShutdown() { * {@code join} or {@code joinUntil} will return immediately. * * + *

    The {@linkplain Subtask.State state} of unfinished subtasks that complete at + * around the time that the task scope is shutdown is not defined. A subtask that + * completes successfully with a result, or fails with an exception, at around + * the time that the task scope is shutdown may or may not transition to a + * terminal state. + * *

    This method may only be invoked by the task scope owner or threads contained * in the task scope. * From 32efd23c5d59c03a6376c92c63f5947e961ee24e Mon Sep 17 00:00:00 2001 From: Cristian Vat Date: Thu, 17 Aug 2023 11:27:39 +0000 Subject: [PATCH 089/162] 8311939: Excessive allocation of Matcher.groups array Reviewed-by: rriggs, igraves --- .../classes/java/util/regex/Matcher.java | 6 +-- .../classes/java/util/regex/Pattern.java | 12 +++++ test/jdk/java/util/regex/RegExTest.java | 52 +++++++++++++++++++ 3 files changed, 66 insertions(+), 4 deletions(-) diff --git a/src/java.base/share/classes/java/util/regex/Matcher.java b/src/java.base/share/classes/java/util/regex/Matcher.java index 8bc07ba0347..4d48e702cdc 100644 --- a/src/java.base/share/classes/java/util/regex/Matcher.java +++ b/src/java.base/share/classes/java/util/regex/Matcher.java @@ -247,8 +247,7 @@ public final class Matcher implements MatchResult { this.text = text; // Allocate state storage - int parentGroupCount = Math.max(parent.capturingGroupCount, 10); - groups = new int[parentGroupCount * 2]; + groups = new int[parent.capturingGroupCount * 2]; locals = new int[parent.localCount]; localsPos = new IntHashSet[parent.localTCNCount]; @@ -422,8 +421,7 @@ public Matcher usePattern(Pattern newPattern) { namedGroups = null; // Reallocate state storage - int parentGroupCount = Math.max(newPattern.capturingGroupCount, 10); - groups = new int[parentGroupCount * 2]; + groups = new int[newPattern.capturingGroupCount * 2]; locals = new int[newPattern.localCount]; for (int i = 0; i < groups.length; i++) groups[i] = -1; diff --git a/src/java.base/share/classes/java/util/regex/Pattern.java b/src/java.base/share/classes/java/util/regex/Pattern.java index 45c48ddab54..054ad4d9da0 100644 --- a/src/java.base/share/classes/java/util/regex/Pattern.java +++ b/src/java.base/share/classes/java/util/regex/Pattern.java @@ -5187,6 +5187,12 @@ static class BackRef extends Node { groupIndex = groupCount + groupCount; } boolean match(Matcher matcher, int i, CharSequence seq) { + // reference to not existing group must never match + // group does not exist if matcher didn't allocate space for it + if (groupIndex >= matcher.groups.length) { + return false; + } + int j = matcher.groups[groupIndex]; int k = matcher.groups[groupIndex+1]; @@ -5223,6 +5229,12 @@ static class CIBackRef extends Node { this.doUnicodeCase = doUnicodeCase; } boolean match(Matcher matcher, int i, CharSequence seq) { + // reference to not existing group must never match + // group does not exist if matcher didn't allocate space for it + if (groupIndex >= matcher.groups.length) { + return false; + } + int j = matcher.groups[groupIndex]; int k = matcher.groups[groupIndex+1]; diff --git a/test/jdk/java/util/regex/RegExTest.java b/test/jdk/java/util/regex/RegExTest.java index 805b8a78d4d..17514521c06 100644 --- a/test/jdk/java/util/regex/RegExTest.java +++ b/test/jdk/java/util/regex/RegExTest.java @@ -2041,6 +2041,58 @@ public static void backRefTest() { check(pattern, toSupplementaries("abcdefghijkk"), true); } + @Test + public static void ciBackRefTest() { + Pattern pattern = Pattern.compile("(?i)(a*)bc\\1"); + check(pattern, "zzzaabcazzz", true); + + pattern = Pattern.compile("(?i)(a*)bc\\1"); + check(pattern, "zzzaabcaazzz", true); + + pattern = Pattern.compile("(?i)(abc)(def)\\1"); + check(pattern, "abcdefabc", true); + + pattern = Pattern.compile("(?i)(abc)(def)\\3"); + check(pattern, "abcdefabc", false); + + for (int i = 1; i < 10; i++) { + // Make sure backref 1-9 are always accepted + pattern = Pattern.compile("(?i)abcdef\\" + i); + // and fail to match if the target group does not exit + check(pattern, "abcdef", false); + } + + pattern = Pattern.compile("(?i)(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)\\11"); + check(pattern, "abcdefghija", false); + check(pattern, "abcdefghija1", true); + + pattern = Pattern.compile("(?i)(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11"); + check(pattern, "abcdefghijkk", true); + + pattern = Pattern.compile("(?i)(a)bcdefghij\\11"); + check(pattern, "abcdefghija1", true); + + // Supplementary character tests + pattern = Pattern.compile("(?i)" + toSupplementaries("(a*)bc\\1")); + check(pattern, toSupplementaries("zzzaabcazzz"), true); + + pattern = Pattern.compile("(?i)" + toSupplementaries("(a*)bc\\1")); + check(pattern, toSupplementaries("zzzaabcaazzz"), true); + + pattern = Pattern.compile("(?i)" + toSupplementaries("(abc)(def)\\1")); + check(pattern, toSupplementaries("abcdefabc"), true); + + pattern = Pattern.compile("(?i)" + toSupplementaries("(abc)(def)\\3")); + check(pattern, toSupplementaries("abcdefabc"), false); + + pattern = Pattern.compile("(?i)" + toSupplementaries("(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)\\11")); + check(pattern, toSupplementaries("abcdefghija"), false); + check(pattern, toSupplementaries("abcdefghija1"), true); + + pattern = Pattern.compile("(?i)" + toSupplementaries("(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11")); + check(pattern, toSupplementaries("abcdefghijkk"), true); + } + /** * Unicode Technical Report #18, section 2.6 End of Line * There is no empty line to be matched in the sequence \u000D\u000A From 2b81885f787d6cf97de556d1774420e2fb7d56f5 Mon Sep 17 00:00:00 2001 From: Per Minborg Date: Thu, 17 Aug 2023 11:31:09 +0000 Subject: [PATCH 090/162] 8314071: Test java/foreign/TestByteBuffer.java timed out Reviewed-by: mcimadamore --- test/jdk/java/foreign/TestByteBuffer.java | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/jdk/java/foreign/TestByteBuffer.java b/test/jdk/java/foreign/TestByteBuffer.java index e3aba287272..53640d39c96 100644 --- a/test/jdk/java/foreign/TestByteBuffer.java +++ b/test/jdk/java/foreign/TestByteBuffer.java @@ -25,7 +25,7 @@ * @test * @enablePreview * @modules java.base/sun.nio.ch java.base/jdk.internal.foreign - * @run testng/othervm --enable-native-access=ALL-UNNAMED TestByteBuffer + * @run testng/othervm/timeout=600 --enable-native-access=ALL-UNNAMED TestByteBuffer */ import java.lang.foreign.*; @@ -82,7 +82,7 @@ public class TestByteBuffer { - static Path tempPath; + static final Path tempPath; static { try { @@ -109,16 +109,16 @@ public class TestByteBuffer { BB_FLOAT.withName("value") )); - static SequenceLayout bytes = MemoryLayout.sequenceLayout(100, JAVA_BYTE); - static SequenceLayout chars = MemoryLayout.sequenceLayout(100, BB_CHAR); - static SequenceLayout shorts = MemoryLayout.sequenceLayout(100, BB_SHORT); - static SequenceLayout ints = MemoryLayout.sequenceLayout(100, BB_INT); - static SequenceLayout floats = MemoryLayout.sequenceLayout(100, BB_FLOAT); - static SequenceLayout longs = MemoryLayout.sequenceLayout(100, BB_LONG); - static SequenceLayout doubles = MemoryLayout.sequenceLayout(100, BB_DOUBLE); + static final SequenceLayout bytes = MemoryLayout.sequenceLayout(100, JAVA_BYTE); + static final SequenceLayout chars = MemoryLayout.sequenceLayout(100, BB_CHAR); + static final SequenceLayout shorts = MemoryLayout.sequenceLayout(100, BB_SHORT); + static final SequenceLayout ints = MemoryLayout.sequenceLayout(100, BB_INT); + static final SequenceLayout floats = MemoryLayout.sequenceLayout(100, BB_FLOAT); + static final SequenceLayout longs = MemoryLayout.sequenceLayout(100, BB_LONG); + static final SequenceLayout doubles = MemoryLayout.sequenceLayout(100, BB_DOUBLE); - static VarHandle indexHandle = tuples.varHandle(PathElement.sequenceElement(), PathElement.groupElement("index")); - static VarHandle valueHandle = tuples.varHandle(PathElement.sequenceElement(), PathElement.groupElement("value")); + static final VarHandle indexHandle = tuples.varHandle(PathElement.sequenceElement(), PathElement.groupElement("index")); + static final VarHandle valueHandle = tuples.varHandle(PathElement.sequenceElement(), PathElement.groupElement("value")); static void initTuples(MemorySegment base, long count) { for (long i = 0; i < count ; i++) { @@ -338,7 +338,7 @@ public void testMappedSegmentAsByteBuffer() throws Throwable { } } - static final long LARGE_SIZE = 3L * 1024L * 1024L * 1024L; // 3GB + static final long LARGE_SIZE = (2L * 1024L + 512L) * 1024L * 1024L; // 2.5 GiB @Test public void testLargeMappedSegment() throws Throwable { From c634bdf9d917c96c38efe826239eab7900c33e74 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Thu, 17 Aug 2023 11:54:24 +0000 Subject: [PATCH 091/162] 8314444: Update jib-profiles.js to use JMH 1.37 devkit Reviewed-by: shade, mikael, erikj --- make/conf/jib-profiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 14d03f63a9a..fa3f2ead713 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -1199,7 +1199,7 @@ var getJibProfilesDependencies = function (input, common) { jmh: { organization: common.organization, ext: "tar.gz", - revision: "1.35+1.0" + revision: "1.37+1.0" }, jcov: { From e8f6b3e4970000e721da9312585e77de49bb8ed8 Mon Sep 17 00:00:00 2001 From: Robbin Ehn Date: Thu, 17 Aug 2023 14:45:59 +0000 Subject: [PATCH 092/162] 8314268: Missing include in assembler_riscv.hpp Reviewed-by: shade, fyang --- src/hotspot/cpu/riscv/assembler_riscv.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp index f96984003f0..2d4e2c8d978 100644 --- a/src/hotspot/cpu/riscv/assembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp @@ -27,6 +27,7 @@ #ifndef CPU_RISCV_ASSEMBLER_RISCV_HPP #define CPU_RISCV_ASSEMBLER_RISCV_HPP +#include "asm/assembler.hpp" #include "asm/register.hpp" #include "code/codeCache.hpp" #include "metaprogramming/enableIf.hpp" From 388dcff72518c96a15e38ff0b18be8a89836c2d5 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Thu, 17 Aug 2023 15:09:09 +0000 Subject: [PATCH 093/162] 8282712: VMConnection.open() does not detect if VM failed to be created, resulting in NPE Reviewed-by: sspitsyn, amenkov --- .../sun/tools/example/debug/tty/VMConnection.java | 12 ++++++++---- test/jdk/com/sun/jdi/VMConnection.java | 10 +++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java index 7f4ae6939cb..555e8272e81 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/VMConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -544,16 +544,18 @@ private VirtualMachine launchTarget() { } catch (IOException ioe) { ioe.printStackTrace(); MessageOutput.fatalError("Unable to launch target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); MessageOutput.fatalError("Internal debugger error."); + throw new RuntimeException(icae); } catch (VMStartException vmse) { MessageOutput.println("vmstartexception", vmse.getMessage()); MessageOutput.println(); dumpFailedLaunchInfo(vmse.process()); MessageOutput.fatalError("Target VM failed to initialize."); + throw new RuntimeException(vmse); } - return null; // Shuts up the compiler } /* attach to running target vm */ @@ -564,11 +566,12 @@ private VirtualMachine attachTarget() { } catch (IOException ioe) { ioe.printStackTrace(); MessageOutput.fatalError("Unable to attach to target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); MessageOutput.fatalError("Internal debugger error."); + throw new RuntimeException(icae); } - return null; // Shuts up the compiler } /* listen for connection from target vm */ @@ -583,10 +586,11 @@ private VirtualMachine listenTarget() { } catch (IOException ioe) { ioe.printStackTrace(); MessageOutput.fatalError("Unable to attach to target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); MessageOutput.fatalError("Internal debugger error."); + throw new RuntimeException(icae); } - return null; // Shuts up the compiler } } diff --git a/test/jdk/com/sun/jdi/VMConnection.java b/test/jdk/com/sun/jdi/VMConnection.java index 18bd3d8956a..1444393e46b 100644 --- a/test/jdk/com/sun/jdi/VMConnection.java +++ b/test/jdk/com/sun/jdi/VMConnection.java @@ -322,15 +322,17 @@ private VirtualMachine launchTarget() { } catch (IOException ioe) { ioe.printStackTrace(); System.err.println("\n Unable to launch target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); System.err.println("\n Internal debugger error."); + throw new RuntimeException(icae); } catch (VMStartException vmse) { System.err.println(vmse.getMessage() + "\n"); dumpFailedLaunchInfo(vmse.process()); System.err.println("\n Target VM failed to initialize."); + throw new RuntimeException(vmse); } - return null; // Shuts up the compiler } /* attach to running target vm */ @@ -341,11 +343,12 @@ private VirtualMachine attachTarget() { } catch (IOException ioe) { ioe.printStackTrace(); System.err.println("\n Unable to attach to target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); System.err.println("\n Internal debugger error."); + throw new RuntimeException(icae); } - return null; // Shuts up the compiler } /* listen for connection from target vm */ @@ -360,10 +363,11 @@ private VirtualMachine listenTarget() { } catch (IOException ioe) { ioe.printStackTrace(); System.err.println("\n Unable to attach to target VM."); + throw new RuntimeException(ioe); } catch (IllegalConnectorArgumentsException icae) { icae.printStackTrace(); System.err.println("\n Internal debugger error."); + throw new RuntimeException(icae); } - return null; // Shuts up the compiler } } From 62ca00158c7ce7b40b5910562c1857b9f05ddf9f Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Thu, 17 Aug 2023 15:26:45 +0000 Subject: [PATCH 094/162] 8313357: Revisit requiring SA tests on OSX to either run as root or use sudo Reviewed-by: dholmes, amenkov --- test/lib/jdk/test/lib/SA/SATestUtils.java | 59 +++++++++++++++++++++-- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/test/lib/jdk/test/lib/SA/SATestUtils.java b/test/lib/jdk/test/lib/SA/SATestUtils.java index 2f98cf99357..82629c1a49d 100644 --- a/test/lib/jdk/test/lib/SA/SATestUtils.java +++ b/test/lib/jdk/test/lib/SA/SATestUtils.java @@ -66,8 +66,9 @@ public static void skipIfCannotAttach() { if (Platform.isHardenedOSX()) { throw new SkippedException("SA Attach not expected to work. JDK is hardened."); } - if (!Platform.isRoot() && !canAddPrivileges()) { - throw new SkippedException("SA Attach not expected to work. Insufficient privileges (not root and can't use sudo)."); + if (needsPrivileges() && !canAddPrivileges()) { + throw new SkippedException("SA Attach not expected to work. Insufficient privileges " + + "(developer mode disabled, not root, and can't use sudo)."); } } } catch (IOException e) { @@ -77,11 +78,54 @@ public static void skipIfCannotAttach() { /** * Returns true if this platform is expected to require extra privileges (running using sudo). + * If we are running as root or developer mode is enabled, then sudo is not needed. */ public static boolean needsPrivileges() { - return Platform.isOSX() && !Platform.isRoot(); + if (!Platform.isOSX()) { + return false; + } + if (Platform.isRoot()) { + return false; + } + return !developerModeEnabled(); } + /* + * Run "DevToolsSecurity --status" to see if developer mode is enabled. + */ + private static boolean developerModeEnabled() { + List cmd = new ArrayList(); + cmd.add("DevToolsSecurity"); + cmd.add("--status"); + ProcessBuilder pb = new ProcessBuilder(cmd); + Process p; + try { + p = pb.start(); + try { + p.waitFor(); + } catch (InterruptedException e) { + throw new RuntimeException("DevToolsSecurity process interrupted", e); + } + + String out = new String(p.getInputStream().readAllBytes()); + String err = new String(p.getErrorStream().readAllBytes()); + System.out.print("DevToolsSecurity stdout: " + out); + if (out.equals("")) System.out.println(); + System.out.print("DevToolsSecurity stderr: " + err); + if (err.equals("")) System.out.println(); + + if (out.contains("Developer mode is currently enabled")) { + return true; + } + if (out.contains("Developer mode is currently disabled")) { + return false; + } + throw new RuntimeException("DevToolsSecurity failed to generate expected output: " + out); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + /** * Returns true if a no-password sudo is expected to work properly. */ @@ -218,9 +262,16 @@ private static boolean canPtraceAttachLinux() throws IOException { * to timeout. For that reason we don't run this test when privileges are needed. Note * it does appear to run fine as root, so we still allow it to run on OSX when privileges * are not required. + * + * Note that we also can't run these tests even if OSX developer mode is enabled (see + * developerModeEnabled()). For the most part the test runs fine, but some reason you end up + * needing to provide admin credentials as the test shuts down. If you don't, it just hangs forever. + * And even after providing the credetials, the test still fails with a timeout. + * + * JDK-8314133 has been filed for these issues. */ public static void validateSADebugDPrivileges() { - if (needsPrivileges()) { + if (Platform.isOSX() && !Platform.isRoot()) { throw new SkippedException("Cannot run this test on OSX if adding privileges is required."); } } From b33ff30d7092893463d8c25ec277d10f3c4fda19 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 17 Aug 2023 16:54:36 +0000 Subject: [PATCH 095/162] 8313661: [REDO] Relax prerequisites for java.base-jmod target Reviewed-by: alanb --- make/Main.gmk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/make/Main.gmk b/make/Main.gmk index e13e6f47386..94d66106507 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -967,11 +967,15 @@ else jdk.compiler-gendata: $(GENSRC_MODULEINFO_TARGETS) # Declare dependencies between jmod targets. - # java.base jmod needs jrt-fs.jar and access to the other jmods to be built. + # java.base jmod needs jrt-fs.jar and access to the jmods for all non + # upgradeable modules and their transitive dependencies. # When creating the BUILDJDK, we don't need to add hashes to java.base, thus # we don't need to depend on all other jmods ifneq ($(CREATING_BUILDJDK), true) - java.base-jmod: jrtfs-jar $(filter-out java.base-jmod, $(JMOD_TARGETS)) + java.base-jmod: jrtfs-jar $(addsuffix -jmod, $(filter-out java.base, $(sort \ + $(foreach m, $(filter-out $(call FindAllUpgradeableModules), $(JMOD_MODULES)), \ + $m $(call FindTransitiveDepsForModules, $m) \ + )))) endif # If not already set, set the JVM target so that the JVM will be built. From 2505cebc5dfeca00d3358d63b127950d8e4f6e48 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Thu, 17 Aug 2023 17:05:54 +0000 Subject: [PATCH 096/162] 8314533: ProblemList runtime/cds/appcds/customLoader/HelloCustom_JFR.java on linux-all with ZGC Reviewed-by: azvegint --- test/hotspot/jtreg/ProblemList-zgc.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/hotspot/jtreg/ProblemList-zgc.txt b/test/hotspot/jtreg/ProblemList-zgc.txt index d9863b4690b..815860250fe 100644 --- a/test/hotspot/jtreg/ProblemList-zgc.txt +++ b/test/hotspot/jtreg/ProblemList-zgc.txt @@ -45,3 +45,5 @@ vmTestbase/gc/gctests/MemoryEaterMT/MemoryEaterMT.java 8289582 windows- vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded002/TestDescription.java 8298302 generic-all vmTestbase/nsk/sysdict/vm/stress/chain/chain007/chain007.java 8298991 linux-x64 + +runtime/cds/appcds/customLoader/HelloCustom_JFR.java 8241075 linux-all From 3bb8afba691965e9036b04b9c7e4727b4c29e776 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 17 Aug 2023 17:32:49 +0000 Subject: [PATCH 097/162] 8314489: Add javadoc index entries for java.lang.Math terms Reviewed-by: alanb --- .../share/classes/java/lang/Math.java | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Math.java b/src/java.base/share/classes/java/lang/Math.java index 67a0e3bc0cd..c851630b95a 100644 --- a/src/java.base/share/classes/java/lang/Math.java +++ b/src/java.base/share/classes/java/lang/Math.java @@ -55,44 +55,46 @@ *

    The quality of implementation specifications concern two * properties, accuracy of the returned result and monotonicity of the * method. Accuracy of the floating-point {@code Math} methods is - * measured in terms of ulps, units in the last place. For a - * given floating-point format, an {@linkplain #ulp(double) ulp} of a - * specific real number value is the distance between the two - * floating-point values bracketing that numerical value. When - * discussing the accuracy of a method as a whole rather than at a - * specific argument, the number of ulps cited is for the worst-case - * error at any argument. If a method always has an error less than - * 0.5 ulps, the method always returns the floating-point number - * nearest the exact result; such a method is correctly - * rounded. A correctly rounded method is generally the best a - * floating-point approximation can be; however, it is impractical for - * many floating-point methods to be correctly rounded. Instead, for - * the {@code Math} class, a larger error bound of 1 or 2 ulps is - * allowed for certain methods. Informally, with a 1 ulp error bound, - * when the exact result is a representable number, the exact result - * should be returned as the computed result; otherwise, either of the - * two floating-point values which bracket the exact result may be - * returned. For exact results large in magnitude, one of the - * endpoints of the bracket may be infinite. Besides accuracy at - * individual arguments, maintaining proper relations between the - * method at different arguments is also important. Therefore, most - * methods with more than 0.5 ulp errors are required to be - * semi-monotonic: whenever the mathematical function is - * non-decreasing, so is the floating-point approximation, likewise, - * whenever the mathematical function is non-increasing, so is the - * floating-point approximation. Not all approximations that have 1 - * ulp accuracy will automatically meet the monotonicity requirements. + * measured in terms of {@index ulp}s, {@index "units in + * the last place"}. For a given floating-point format, an + * {@linkplain #ulp(double) ulp} of a specific real number value is + * the distance between the two floating-point values bracketing that + * numerical value. When discussing the accuracy of a method as a + * whole rather than at a specific argument, the number of ulps cited + * is for the worst-case error at any argument. If a method always + * has an error less than 0.5 ulps, the method always returns the + * floating-point number nearest the exact result; such a method is + * correctly rounded. A {@index "correctly rounded"} + * method is generally the best a floating-point approximation can be; + * however, it is impractical for many floating-point methods to be + * correctly rounded. Instead, for the {@code Math} class, a larger + * error bound of 1 or 2 ulps is allowed for certain methods. + * Informally, with a 1 ulp error bound, when the exact result is a + * representable number, the exact result should be returned as the + * computed result; otherwise, either of the two floating-point values + * which bracket the exact result may be returned. For exact results + * large in magnitude, one of the endpoints of the bracket may be + * infinite. Besides accuracy at individual arguments, maintaining + * proper relations between the method at different arguments is also + * important. Therefore, most methods with more than 0.5 ulp errors + * are required to be {@index "semi-monotonic"}: whenever + * the mathematical function is non-decreasing, so is the + * floating-point approximation, likewise, whenever the mathematical + * function is non-increasing, so is the floating-point approximation. + * Not all approximations that have 1 ulp accuracy will automatically + * meet the monotonicity requirements. * *

    * The platform uses signed two's complement integer arithmetic with - * int and long primitive types. The developer should choose - * the primitive type to ensure that arithmetic operations consistently - * produce correct results, which in some cases means the operations - * will not overflow the range of values of the computation. - * The best practice is to choose the primitive type and algorithm to avoid - * overflow. In cases where the size is {@code int} or {@code long} and - * overflow errors need to be detected, the methods whose names end with - * {@code Exact} throw an {@code ArithmeticException} when the results overflow. + * {@code int} and {@code long} primitive types. The developer should + * choose the primitive type to ensure that arithmetic operations + * consistently produce correct results, which in some cases means the + * operations will not overflow the range of values of the + * computation. The best practice is to choose the primitive type and + * algorithm to avoid overflow. In cases where the size is {@code int} + * or {@code long} and overflow errors need to be detected, the + * methods whose names end with {@code Exact} throw an {@code + * ArithmeticException} when the results overflow. * *

    IEEE 754 Recommended * Operations

    @@ -119,7 +121,6 @@ * @see * IEEE Standard for Floating-Point Arithmetic * - * @author Joseph D. Darcy * @since 1.0 */ From a8ab3be371ab84ad768d9788a1e7a8d1bb833426 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Thu, 17 Aug 2023 17:54:02 +0000 Subject: [PATCH 098/162] 8314261: Make fields final in sun.net.www Reviewed-by: redestad, jpai, dfuchs --- .../share/classes/sun/net/www/MimeTable.java | 4 ++-- .../classes/sun/net/www/URLConnection.java | 2 +- .../sun/net/www/http/ChunkedInputStream.java | 6 ++--- .../sun/net/www/http/ChunkedOutputStream.java | 20 ++++++++--------- .../classes/sun/net/www/http/HttpCapture.java | 4 ++-- .../classes/sun/net/www/http/HttpClient.java | 6 ++--- .../net/www/http/KeepAliveStreamCleaner.java | 10 ++++----- .../www/protocol/file/FileURLConnection.java | 10 ++++----- .../www/protocol/ftp/FtpURLConnection.java | 8 ++----- .../protocol/http/AuthenticationHeader.java | 13 ++++++----- .../protocol/http/DigestAuthentication.java | 6 +---- .../www/protocol/http/HttpURLConnection.java | 22 ++++++++++--------- .../sun/net/www/protocol/jar/URLJarFile.java | 4 ++-- 13 files changed, 55 insertions(+), 60 deletions(-) diff --git a/src/java.base/share/classes/sun/net/www/MimeTable.java b/src/java.base/share/classes/sun/net/www/MimeTable.java index 926fe7d60b3..9da69d58aa7 100644 --- a/src/java.base/share/classes/sun/net/www/MimeTable.java +++ b/src/java.base/share/classes/sun/net/www/MimeTable.java @@ -45,10 +45,10 @@ public class MimeTable implements FileNameMap { private static final int HASH_MARK = '#'; /** Keyed by content type, returns MimeEntries */ - private Hashtable entries = new Hashtable<>(); + private final Hashtable entries = new Hashtable<>(); /** Keyed by file extension (with the .), returns MimeEntries */ - private Hashtable extensionMap = new Hashtable<>(); + private final Hashtable extensionMap = new Hashtable<>(); // Will be reset if in the platform-specific data file @SuppressWarnings("removal") diff --git a/src/java.base/share/classes/sun/net/www/URLConnection.java b/src/java.base/share/classes/sun/net/www/URLConnection.java index 6851367ad67..66005ab9b2a 100644 --- a/src/java.base/share/classes/sun/net/www/URLConnection.java +++ b/src/java.base/share/classes/sun/net/www/URLConnection.java @@ -261,7 +261,7 @@ public void close() { url = null; } - private static HashMap proxiedHosts = new HashMap<>(); + private static final HashMap proxiedHosts = new HashMap<>(); public static synchronized void setProxiedHost(String host) { proxiedHosts.put(host.toLowerCase(Locale.ROOT), null); diff --git a/src/java.base/share/classes/sun/net/www/http/ChunkedInputStream.java b/src/java.base/share/classes/sun/net/www/http/ChunkedInputStream.java index b5809aaa86c..f229cf3a6eb 100644 --- a/src/java.base/share/classes/sun/net/www/http/ChunkedInputStream.java +++ b/src/java.base/share/classes/sun/net/www/http/ChunkedInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,13 +50,13 @@ public class ChunkedInputStream extends InputStream implements Hurryable { * The HttpClient that should be notified when the chunked stream has * completed. */ - private HttpClient hc; + private final HttpClient hc; /** * The MessageHeader that is populated with any optional trailer * that appear after the last chunk. */ - private MessageHeader responses; + private final MessageHeader responses; /** * The size, in bytes, of the chunk that is currently being read. diff --git a/src/java.base/share/classes/sun/net/www/http/ChunkedOutputStream.java b/src/java.base/share/classes/sun/net/www/http/ChunkedOutputStream.java index 4cf485cc33e..93584e641b4 100644 --- a/src/java.base/share/classes/sun/net/www/http/ChunkedOutputStream.java +++ b/src/java.base/share/classes/sun/net/www/http/ChunkedOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ public class ChunkedOutputStream extends OutputStream { private static final int EMPTY_CHUNK_HEADER_SIZE = getHeaderSize(0); /* internal buffer */ - private byte buf[]; + private final byte[] buf; /* size of data (excluding footers and headers) already stored in buf */ private int size; /* current index in buf (i.e. buf[count] */ @@ -59,11 +59,11 @@ public class ChunkedOutputStream extends OutputStream { private PrintStream out; /* the chunk size we use */ - private int preferredChunkDataSize; - private int preferedHeaderSize; - private int preferredChunkGrossSize; + private final int preferredChunkDataSize; + private final int preferredHeaderSize; + private final int preferredChunkGrossSize; /* header for a complete Chunk */ - private byte[] completeHeader; + private final byte[] completeHeader; private final Lock writeLock = new ReentrantLock(); @@ -119,8 +119,8 @@ public ChunkedOutputStream(PrintStream o, int size) { getHeaderSize(DEFAULT_CHUNK_SIZE) - FOOTER_SIZE; } - preferedHeaderSize = getHeaderSize(preferredChunkDataSize); - preferredChunkGrossSize = preferedHeaderSize + preferredChunkDataSize + preferredHeaderSize = getHeaderSize(preferredChunkDataSize); + preferredChunkGrossSize = preferredHeaderSize + preferredChunkDataSize + FOOTER_SIZE; completeHeader = getHeader(preferredChunkDataSize); @@ -151,7 +151,7 @@ private void flush(boolean flushAll) { /* adjust a header start index in case the header of the last * chunk is shorter then preferedHeaderSize */ - int adjustedHeaderStartIndex = preferedHeaderSize - + int adjustedHeaderStartIndex = preferredHeaderSize - getHeaderSize(size); /* write header */ @@ -277,7 +277,7 @@ public void write(int _b) throws IOException { public void reset() { writeLock.lock(); try { - count = preferedHeaderSize; + count = preferredHeaderSize; size = 0; spaceInCurrentChunk = preferredChunkDataSize; } finally { diff --git a/src/java.base/share/classes/sun/net/www/http/HttpCapture.java b/src/java.base/share/classes/sun/net/www/http/HttpCapture.java index 1d2732e0473..ba7e5af6cdf 100644 --- a/src/java.base/share/classes/sun/net/www/http/HttpCapture.java +++ b/src/java.base/share/classes/sun/net/www/http/HttpCapture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,7 +56,7 @@ public class HttpCapture { // HttpCapture does blocking I/O operations while holding monitors. // This is not a concern because it is rarely used. - private File file; + private final File file; private boolean incoming = true; private BufferedWriter out; private static boolean initialized; diff --git a/src/java.base/share/classes/sun/net/www/http/HttpClient.java b/src/java.base/share/classes/sun/net/www/http/HttpClient.java index a1c9e972990..01c341401d8 100644 --- a/src/java.base/share/classes/sun/net/www/http/HttpClient.java +++ b/src/java.base/share/classes/sun/net/www/http/HttpClient.java @@ -98,13 +98,13 @@ private static int getDefaultPort(String proto) { protected int port; /* where we cache currently open, persistent connections */ - protected static KeepAliveCache kac = new KeepAliveCache(); + protected static final KeepAliveCache kac = new KeepAliveCache(); - private static boolean keepAliveProp = true; + private static final boolean keepAliveProp; // retryPostProp is true by default so as to preserve behavior // from previous releases. - private static boolean retryPostProp = true; + private static final boolean retryPostProp; /* Value of the system property jdk.ntlm.cache; if false, then NTLM connections will not be cached. diff --git a/src/java.base/share/classes/sun/net/www/http/KeepAliveStreamCleaner.java b/src/java.base/share/classes/sun/net/www/http/KeepAliveStreamCleaner.java index cc0b0cce0e9..79bdb8cc64f 100644 --- a/src/java.base/share/classes/sun/net/www/http/KeepAliveStreamCleaner.java +++ b/src/java.base/share/classes/sun/net/www/http/KeepAliveStreamCleaner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,10 +51,10 @@ class KeepAliveStreamCleaner implements Runnable { // maximum amount of remaining data that we will try to cleanup - protected static int MAX_DATA_REMAINING = 512; + protected static final int MAX_DATA_REMAINING; // maximum amount of KeepAliveStreams to be queued - protected static int MAX_CAPACITY = 10; + protected static final int MAX_CAPACITY; // timeout for both socket and poll on the queue protected static final int TIMEOUT = 5000; @@ -68,7 +68,7 @@ class KeepAliveStreamCleaner int maxData = AccessController.doPrivileged( new PrivilegedAction() { public Integer run() { - return NetProperties.getInteger(maxDataKey, MAX_DATA_REMAINING); + return NetProperties.getInteger(maxDataKey, 512); }}).intValue() * 1024; MAX_DATA_REMAINING = maxData; @@ -77,7 +77,7 @@ public Integer run() { int maxCapacity = AccessController.doPrivileged( new PrivilegedAction() { public Integer run() { - return NetProperties.getInteger(maxCapacityKey, MAX_CAPACITY); + return NetProperties.getInteger(maxCapacityKey, 10); }}).intValue(); MAX_CAPACITY = maxCapacity; diff --git a/src/java.base/share/classes/sun/net/www/protocol/file/FileURLConnection.java b/src/java.base/share/classes/sun/net/www/protocol/file/FileURLConnection.java index 545dc4b69e5..a27a6137a37 100644 --- a/src/java.base/share/classes/sun/net/www/protocol/file/FileURLConnection.java +++ b/src/java.base/share/classes/sun/net/www/protocol/file/FileURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,10 +42,10 @@ public class FileURLConnection extends URLConnection { - static String CONTENT_LENGTH = "content-length"; - static String CONTENT_TYPE = "content-type"; - static String TEXT_PLAIN = "text/plain"; - static String LAST_MODIFIED = "last-modified"; + private static final String CONTENT_LENGTH = "content-length"; + private static final String CONTENT_TYPE = "content-type"; + private static final String TEXT_PLAIN = "text/plain"; + private static final String LAST_MODIFIED = "last-modified"; String contentType; InputStream is; diff --git a/src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java b/src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java index ecc17ea85ec..f559cc5b820 100644 --- a/src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java +++ b/src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,10 +23,6 @@ * questions. */ -/** - * FTP stream opener. - */ - package sun.net.www.protocol.ftp; import java.io.IOException; @@ -84,7 +80,7 @@ public class FtpURLConnection extends URLConnection { // In case we have to use proxies, we use HttpURLConnection HttpURLConnection http = null; - private Proxy instProxy; + private final Proxy instProxy; InputStream is = null; OutputStream os = null; diff --git a/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java b/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java index bf237259e18..8083fb36f39 100644 --- a/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java +++ b/src/java.base/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java @@ -91,14 +91,14 @@ public class AuthenticationHeader { // When set true, do not use Negotiate even if the response // headers suggest so. boolean dontUseNegotiate = false; - static String authPref=null; + private static final String authPref; public String toString() { return "AuthenticationHeader: prefer " + preferred_r; } static { - authPref = GetPropertyAction.privilegedGetProperty("http.auth.preference"); + String pref = GetPropertyAction.privilegedGetProperty("http.auth.preference"); // http.auth.preference can be set to SPNEGO or Kerberos. // In fact they means "Negotiate with SPNEGO" and "Negotiate with @@ -106,12 +106,13 @@ public String toString() { // Negotiate. Read NegotiateAuthentication.java to see how they // were used later. - if (authPref != null) { - authPref = authPref.toLowerCase(Locale.ROOT); - if(authPref.equals("spnego") || authPref.equals("kerberos")) { - authPref = "negotiate"; + if (pref != null) { + pref = pref.toLowerCase(Locale.ROOT); + if (pref.equals("spnego") || pref.equals("kerberos")) { + pref = "negotiate"; } } + authPref = pref; } String hdrname; // Name of the header to look for diff --git a/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java b/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java index 66e78c866b7..faee05b4dfd 100644 --- a/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java +++ b/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java @@ -171,11 +171,7 @@ static class Parameters implements java.io.Serializable { private static final int cnoncelen = 40; /* number of characters in cnonce */ - private static Random random; - - static { - random = new Random(); - } + private static final Random random = new Random(); Parameters () { serverQop = false; diff --git a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index cbd24ee2f0b..f505ea4a59f 100644 --- a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -162,15 +162,15 @@ public class HttpURLConnection extends java.net.HttpURLConnection { /* Should we enable buffering of error streams? */ - private static boolean enableESBuffer = false; + private static final boolean enableESBuffer; /* timeout waiting for read for buffered error stream; */ - private static int timeout4ESBuffer = 0; + private static final int timeout4ESBuffer; /* buffer size for buffered error stream; */ - private static int bufSize4ES = 0; + private static final int bufSize4ES; /* * Restrict setting of request headers through the public api @@ -264,17 +264,19 @@ private static Set schemesListToSet(String list) { enableESBuffer = Boolean.parseBoolean( props.getProperty("sun.net.http.errorstream.enableBuffering")); - timeout4ESBuffer = GetIntegerAction.privilegedGetProperty( + int esBufferTimeout = GetIntegerAction.privilegedGetProperty( "sun.net.http.errorstream.timeout", 300); - if (timeout4ESBuffer <= 0) { - timeout4ESBuffer = 300; // use the default + if (esBufferTimeout <= 0) { + esBufferTimeout = 300; // use the default } + timeout4ESBuffer = esBufferTimeout; - bufSize4ES = GetIntegerAction.privilegedGetProperty( + int esBufSize = GetIntegerAction.privilegedGetProperty( "sun.net.http.errorstream.bufferSize", 4096); - if (bufSize4ES <= 0) { - bufSize4ES = 4096; // use the default + if (esBufSize <= 0) { + esBufSize = 4096; // use the default } + bufSize4ES = esBufSize; allowRestrictedHeaders = Boolean.parseBoolean( props.getProperty("sun.net.http.allowRestrictedHeaders")); @@ -349,7 +351,7 @@ private static Set schemesListToSet(String list) { /* The headers actually set by the user are recorded here also */ - private MessageHeader userHeaders; + private final MessageHeader userHeaders; /* Headers and request method cannot be changed * once this flag is set in :- diff --git a/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java b/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java index 47ac1f13064..c5216d87e6c 100644 --- a/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java +++ b/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -246,7 +246,7 @@ public static void setCallBack(URLJarFileCallBack cb) private class URLJarFileEntry extends JarEntry { - private JarEntry je; + private final JarEntry je; URLJarFileEntry(JarEntry je) { super(je); From d27daf01d6361513a815e78327961f9367887163 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Thu, 17 Aug 2023 18:32:06 +0000 Subject: [PATCH 099/162] 8314129: Make fields final in java.util.Scanner Reviewed-by: stsypanov, liach, alanb --- .../share/classes/java/util/Scanner.java | 51 ++++++++++++------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/src/java.base/share/classes/java/util/Scanner.java b/src/java.base/share/classes/java/util/Scanner.java index f270a46cc49..e5ad20f95d7 100644 --- a/src/java.base/share/classes/java/util/Scanner.java +++ b/src/java.base/share/classes/java/util/Scanner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,17 +25,34 @@ package java.util; -import java.io.*; -import java.math.*; -import java.nio.*; -import java.nio.channels.*; -import java.nio.charset.*; +import java.io.Closeable; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.nio.CharBuffer; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.UnsupportedCharsetException; import java.nio.file.Path; import java.nio.file.Files; -import java.text.*; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.NumberFormat; import java.text.spi.NumberFormatProvider; import java.util.function.Consumer; -import java.util.regex.*; +import java.util.regex.MatchResult; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; import java.util.stream.Stream; import java.util.stream.StreamSupport; import sun.util.locale.provider.LocaleProviderAdapter; @@ -317,13 +334,13 @@ public final class Scanner implements Iterator, Closeable { private CharBuffer buf; // Size of internal character buffer - private static final int BUFFER_SIZE = 1024; // change to 1024; + private static final int BUFFER_SIZE = 1024; // The index into the buffer currently held by the Scanner private int position; // Internal matcher used for finding delimiters - private Matcher matcher; + private final Matcher matcher; // Pattern used to delimit tokens private Pattern delimPattern; @@ -371,7 +388,7 @@ public final class Scanner implements Iterator, Closeable { private Locale locale = null; // A cache of the last few recently used Patterns - private PatternLRUCache patternCache = new PatternLRUCache(7); + private final PatternLRUCache patternCache = new PatternLRUCache(7); // A holder of the last IOException encountered private IOException lastException; @@ -382,14 +399,14 @@ public final class Scanner implements Iterator, Closeable { int modCount; // A pattern for java whitespace - private static Pattern WHITESPACE_PATTERN = Pattern.compile( + private static final Pattern WHITESPACE_PATTERN = Pattern.compile( "\\p{javaWhitespace}+"); // A pattern for any token - private static Pattern FIND_ANY_PATTERN = Pattern.compile("(?s).*"); + private static final Pattern FIND_ANY_PATTERN = Pattern.compile("(?s).*"); // A pattern for non-ASCII digits - private static Pattern NON_ASCII_DIGIT = Pattern.compile( + private static final Pattern NON_ASCII_DIGIT = Pattern.compile( "[\\p{javaDigit}&&[^0-9]]"); // Fields and methods to support scanning primitive types @@ -423,9 +440,9 @@ private static Pattern boolPattern() { * Fields and methods to match bytes, shorts, ints, and longs */ private Pattern integerPattern; - private String digits = "0123456789abcdefghijklmnopqrstuvwxyz"; - private String non0Digit = "[\\p{javaDigit}&&[^0]]"; - private int SIMPLE_GROUP_INDEX = 5; + private static final String digits = "0123456789abcdefghijklmnopqrstuvwxyz"; + private static final String non0Digit = "[\\p{javaDigit}&&[^0]]"; + private static final int SIMPLE_GROUP_INDEX = 5; private String buildIntegerPatternString() { String radixDigits = digits.substring(0, radix); // \\p{javaDigit} is not guaranteed to be appropriate From 6445314fec25b85db32d9fb75c9c1b29e07f01cb Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 17 Aug 2023 20:25:46 +0000 Subject: [PATCH 100/162] 8314477: Improve definition of "prototypical type" Reviewed-by: prappo --- .../classes/javax/lang/model/element/TypeElement.java | 8 +++++++- .../share/classes/javax/lang/model/package-info.java | 8 ++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java b/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java index 48bc4132eea..b99903a03fe 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java @@ -88,7 +88,7 @@ public interface TypeElement extends Element, Parameterizable, QualifiedNameable { /** * Returns the type defined by this class or interface element, - * returning the prototypical type for an element + * returning the {@index "prototypical type"} for an element * representing a generic type. * *

    A generic element defines a family of types, not just one. @@ -98,6 +98,12 @@ public interface TypeElement extends Element, Parameterizable, QualifiedNameable * For example, * for the generic class element {@code C}, * the parameterized type {@code C} is returned. + * Otherwise, for a non-generic class or interface, the + * prototypical type mirror corresponds to a use of the type. + * None of the components of the prototypical type are annotated, + * including the prototypical type itself. + * + * @apiNote * The {@link Types} utility interface has more general methods * for obtaining the full range of types defined by an element. * diff --git a/src/java.compiler/share/classes/javax/lang/model/package-info.java b/src/java.compiler/share/classes/javax/lang/model/package-info.java index 5377b48065d..9df3e7f3b0a 100644 --- a/src/java.compiler/share/classes/javax/lang/model/package-info.java +++ b/src/java.compiler/share/classes/javax/lang/model/package-info.java @@ -114,12 +114,8 @@ * javax.lang.model.element.Element#asType() mapped to} some type. * The elements for classes and interfaces get {@linkplain * javax.lang.model.element.TypeElement#asType() mapped to} a - * prototypical type. (If a class or interface is generic, its - * prototypical type mirror is parameterized with type arguments - * matching the type variables of the declaration, all - * unannotated. Otherwise, for a non-generic class or interface, the - * prototypical type mirror corresponds to an unannotated use of the - * type.) Conversely, in general, many types can map to the same + * {@linkplain javax.lang.model.element.TypeElement#asType() prototypical type}. + * Conversely, in general, many types can map to the same * {@linkplain javax.lang.model.element.TypeElement type element}. For * example, the type mirror for the raw type {@code java.util.Set}, * the prototypical type {@code java.util.Set}, and the type {@code From 808bb1f7bc5025b4ab01e4e9057feebd253b95a7 Mon Sep 17 00:00:00 2001 From: Harshitha Onkar Date: Thu, 17 Aug 2023 20:37:06 +0000 Subject: [PATCH 101/162] 8314246: javax/swing/JToolBar/4529206/bug4529206.java fails intermittently on Linux Reviewed-by: dnguyen, serb --- .../swing/JToolBar/4529206/bug4529206.java | 52 +++++++------------ 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/test/jdk/javax/swing/JToolBar/4529206/bug4529206.java b/test/jdk/javax/swing/JToolBar/4529206/bug4529206.java index 8844254dba4..ed4f062b24c 100644 --- a/test/jdk/javax/swing/JToolBar/4529206/bug4529206.java +++ b/test/jdk/javax/swing/JToolBar/4529206/bug4529206.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,19 +21,9 @@ * questions. */ -/* - * @test - * @key headful - * @bug 4529206 - * @summary JToolBar - setFloating does not work correctly - * @run main bug4529206 - */ - import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Robot; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; @@ -41,6 +31,14 @@ import javax.swing.JToolBar; import javax.swing.SwingUtilities; +/* + * @test + * @key headful + * @bug 4529206 + * @summary JToolBar - setFloating does not work correctly + * @run main bug4529206 + */ + public class bug4529206 { static JFrame frame; static JToolBar jToolBar1; @@ -58,11 +56,7 @@ private static void test() { JTextField tf = new JTextField("click here"); jPanFrame.add(tf); jToolBar1.add(jButton1, null); - jButton1.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - buttonPressed(e); - } - }); + jButton1.addActionListener(e -> buttonPressed()); frame.setUndecorated(true); frame.setLocationRelativeTo(null); @@ -77,32 +71,24 @@ private static void makeToolbarFloat() { } } - private static void buttonPressed(ActionEvent e) { + private static void buttonPressed() { makeToolbarFloat(); } public static void main(String[] args) throws Exception { try { - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - test(); - } - }); + SwingUtilities.invokeAndWait(() -> test()); Robot robot = new Robot(); - robot.waitForIdle(); + robot.setAutoWaitForIdle(true); robot.delay(1000); - SwingUtilities.invokeAndWait(() -> { - makeToolbarFloat(); - }); + SwingUtilities.invokeAndWait(() -> makeToolbarFloat()); + robot.delay(300); - robot.waitForIdle(); - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - if (frame.isFocused()) { - throw - new RuntimeException("setFloating does not work correctly"); - } + SwingUtilities.invokeAndWait(() -> { + if (frame.isFocused()) { + throw + new RuntimeException("setFloating does not work correctly"); } }); } finally { From 96778dd549b596d8884376b19a49aa152efb377b Mon Sep 17 00:00:00 2001 From: Justin Lu Date: Thu, 17 Aug 2023 22:41:21 +0000 Subject: [PATCH 102/162] 8314169: Combine related RoundingMode logic in j.text.DigitList Reviewed-by: naoto --- .../share/classes/java/text/DigitList.java | 187 ++++++++---------- 1 file changed, 85 insertions(+), 102 deletions(-) diff --git a/src/java.base/share/classes/java/text/DigitList.java b/src/java.base/share/classes/java/text/DigitList.java index e574cafe0a6..fde0e93214a 100644 --- a/src/java.base/share/classes/java/text/DigitList.java +++ b/src/java.base/share/classes/java/text/DigitList.java @@ -112,12 +112,21 @@ final class DigitList implements Cloneable { * Return true if the represented number is zero. */ boolean isZero() { - for (int i=0; i < count; ++i) { + return !nonZeroAfterIndex(0); + } + + + /** + * Return true if there exists a non-zero digit in the digit list + * from the given index until the end. + */ + private boolean nonZeroAfterIndex(int index) { + for (int i=index; i < count; ++i) { if (digits[i] != '0') { - return false; + return true; } } - return true; + return false; } /** @@ -190,9 +199,7 @@ public final long getLong() { StringBuilder temp = getStringBuilder(); temp.append(digits, 0, count); - for (int i = count; i < decimalAt; ++i) { - temp.append('0'); - } + temp.append("0".repeat(Math.max(0, decimalAt - count))); return Long.parseLong(temp.toString()); } @@ -392,6 +399,17 @@ private void set(boolean isNegative, String s, } + /** + * Round the representation to the given number of digits. + * @param maximumDigits The maximum number of digits to be shown. + * + * Upon return, count will be less than or equal to maximumDigits. + */ + private void roundInt(int maximumDigits) { + // Integers do not need to worry about double rounding + round(maximumDigits, false, true); + } + /** * Round the representation to the given number of digits. * @param maximumDigits The maximum number of digits to be shown. @@ -408,25 +426,8 @@ private final void round(int maximumDigits, // Round up if appropriate. if (maximumDigits >= 0 && maximumDigits < count) { if (shouldRoundUp(maximumDigits, alreadyRounded, valueExactAsDecimal)) { - // Rounding up involved incrementing digits from LSD to MSD. - // In most cases this is simple, but in a worst case situation - // (9999..99) we have to adjust the decimalAt value. - for (;;) { - --maximumDigits; - if (maximumDigits < 0) { - // We have all 9's, so we increment to a single digit - // of one and adjust the exponent. - digits[0] = '1'; - ++decimalAt; - maximumDigits = 0; // Adjust the count - break; - } - - ++digits[maximumDigits]; - if (digits[maximumDigits] <= '9') break; - // digits[maximumDigits] = '0'; // Unnecessary since we'll truncate this - } - ++maximumDigits; // Increment for use as count + // Rounding can adjust the max digits + maximumDigits = roundUp(maximumDigits); } count = maximumDigits; @@ -508,94 +509,44 @@ private boolean shouldRoundUp(int maximumDigits, switch(roundingMode) { case UP: - for (int i=maximumDigits; i '5') { - // Value is above tie ==> must round up - return true; - } else if (digits[maximumDigits] == '5') { - // Digit at rounding position is a '5'. Tie cases. - if (maximumDigits != (count - 1)) { - // There are remaining digits. Above tie => must round up - return true; - } else { - // Digit at rounding position is the last one ! - if (valueExactAsDecimal) { - // Exact binary representation. On the tie. - // Apply rounding given by roundingMode. - return roundingMode == RoundingMode.HALF_UP; - } else { - // Not an exact binary representation. - // Digit sequence either rounded up or truncated. - // Round up only if it was truncated. - return !alreadyRounded; - } - } - } - // Digit at rounding position is < '5' ==> no round up. - // Just let do the default, which is no round up (thus break). - break; case HALF_EVEN: - // Implement IEEE half-even rounding + // Above tie, round up for all cases if (digits[maximumDigits] > '5') { return true; + // At tie, consider UP, DOWN, and EVEN logic } else if (digits[maximumDigits] == '5' ) { + // Rounding position is the last index, there are 3 Cases. if (maximumDigits == (count - 1)) { - // the rounding position is exactly the last index : - if (alreadyRounded) - // If FloatingDecimal rounded up (value was below tie), - // then we should not round up again. - return false; - - if (!valueExactAsDecimal) - // Otherwise if the digits don't represent exact value, - // value was above tie and FloatingDecimal truncated - // digits to tie. We must round up. - return true; - else { - // This is an exact tie value, and FloatingDecimal - // provided all of the exact digits. We thus apply - // HALF_EVEN rounding rule. - return ((maximumDigits > 0) && - (digits[maximumDigits-1] % 2 != 0)); + // When exact, consider specific contract logic + if (valueExactAsDecimal) { + return (roundingMode == RoundingMode.HALF_UP) || + (roundingMode == RoundingMode.HALF_EVEN + && (maximumDigits > 0) && (digits[maximumDigits - 1] % 2 != 0)); + // If already rounded, do not round again, otherwise round up + } else { + return !alreadyRounded; } + // Rounding position is not the last index + // If any further digits have a non-zero value, round up } else { - // Rounds up if it gives a non null digit after '5' - for (int i=maximumDigits+1; i '9'); + + return ++maximumDigits; // Increment for use as count + } + /** * Utility routine to set the value of the digit list from a long */ @@ -649,12 +627,16 @@ final void set(boolean isNegative, long source, int maximumDigits) { decimalAt = MAX_COUNT - left; // Don't copy trailing zeros. We are guaranteed that there is at // least one non-zero digit, so we don't have to check lower bounds. - for (right = MAX_COUNT - 1; digits[right] == '0'; --right) - ; + right = MAX_COUNT - 1; + while (digits[right] == '0') { + --right; + } count = right - left + 1; System.arraycopy(digits, left, digits, 0, count); } - if (maximumDigits > 0) round(maximumDigits, false, true); + if (maximumDigits > 0) { + roundInt(maximumDigits); + } } /** @@ -692,13 +674,14 @@ final void set(boolean isNegative, BigInteger source, int maximumDigits) { s.getChars(0, len, digits, 0); decimalAt = len; - int right; - for (right = len - 1; right >= 0 && digits[right] == '0'; --right) - ; + int right = len - 1; + while (right >= 0 && digits[right] == '0') { + --right; + } count = right + 1; if (maximumDigits > 0) { - round(maximumDigits, false, true); + roundInt(maximumDigits); } } From 0299364d85a66c35e616148cbbde314b7d4fb05a Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Thu, 17 Aug 2023 22:52:05 +0000 Subject: [PATCH 103/162] 8314249: Refactor handling of invokedynamic in JVMCI ConstantPool Reviewed-by: dnsimon, coleenp --- src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 4 +- .../jdk/vm/ci/hotspot/CompilerToVM.java | 13 ++- .../vm/ci/hotspot/HotSpotConstantPool.java | 87 ++++++++------- .../classes/jdk/vm/ci/meta/ConstantPool.java | 21 ++-- .../ci/hotspot/test/TestDynamicConstant.java | 8 +- .../vm/ci/runtime/test/ConstantPoolTest.java | 101 +++++++++++++++++- 6 files changed, 166 insertions(+), 68 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index e5b62375d2a..9b9e8b46d1c 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -906,9 +906,9 @@ C2V_VMENTRY_NULL(jobject, lookupKlassInPool, (JNIEnv* env, jobject, ARGUMENT_PAI return JVMCIENV->get_jobject(result); C2V_END -C2V_VMENTRY_NULL(jobject, lookupAppendixInPool, (JNIEnv* env, jobject, ARGUMENT_PAIR(cp), jint index)) +C2V_VMENTRY_NULL(jobject, lookupAppendixInPool, (JNIEnv* env, jobject, ARGUMENT_PAIR(cp), jint which)) constantPoolHandle cp(THREAD, UNPACK_PAIR(ConstantPool, cp)); - oop appendix_oop = ConstantPool::appendix_at_if_loaded(cp, index); + oop appendix_oop = ConstantPool::appendix_at_if_loaded(cp, which); return JVMCIENV->get_jobject(JVMCIENV->get_object_constant(appendix_oop)); C2V_END diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java index ed96bd03597..bb6e8bc32fb 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java @@ -560,14 +560,17 @@ int constantPoolRemapInstructionOperandFromCache(HotSpotConstantPool constantPoo private native int constantPoolRemapInstructionOperandFromCache(HotSpotConstantPool constantPool, long constantPoolPointer, int cpci); /** - * Gets the appendix object (if any) associated with the entry at index {@code cpi} in - * {@code constantPool}. + * Gets the appendix object (if any) associated with the entry identified by {@code which}. + * + * @param which if negative, is treated as an encoded indy index for INVOKEDYNAMIC; + * Otherwise, it's treated as a constant pool cache index (returned by HotSpotConstantPool::rawIndexToConstantPoolCacheIndex) + * for INVOKE{VIRTUAL,SPECIAL,STATIC,INTERFACE}. */ - HotSpotObjectConstantImpl lookupAppendixInPool(HotSpotConstantPool constantPool, int cpi) { - return lookupAppendixInPool(constantPool, constantPool.getConstantPoolPointer(), cpi); + HotSpotObjectConstantImpl lookupAppendixInPool(HotSpotConstantPool constantPool, int which) { + return lookupAppendixInPool(constantPool, constantPool.getConstantPoolPointer(), which); } - private native HotSpotObjectConstantImpl lookupAppendixInPool(HotSpotConstantPool constantPool, long constantPoolPointer, int cpi); + private native HotSpotObjectConstantImpl lookupAppendixInPool(HotSpotConstantPool constantPool, long constantPoolPointer, int which); /** * Installs the result of a compilation into the code cache. diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java index 2fb33ef7a28..d4bb97f03c4 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java @@ -47,6 +47,19 @@ /** * Implementation of {@link ConstantPool} for HotSpot. + * + * The following convention is used in the jdk.vm.ci.hotspot package when accessing the ConstantPool with an index: + *

      + *
    • rawIndex - Index in the bytecode stream after the opcode (could be rewritten for some opcodes)
    • + *
    • cpi - The constant pool index (as specified in JVM Spec)
    • + *
    • cpci - The constant pool cache index, used only by the four bytecodes INVOKE{VIRTUAL,SPECIAL,STATIC,INTERFACE}. + * It's the same as {@code rawIndex + HotSpotVMConfig::constantPoolCpCacheIndexTag}.
    • + *
    • which - May be either a {@code rawIndex} or a {@code cpci}.
    • + *
    + * + * Note that {@code cpci} and {@code which} are used only in the HotSpot-specific implementation. They + * are not used by the public interface in jdk.vm.ci.meta.*. + * After JDK-8301993, all uses of {@code cpci} and {@code which} will be replaced with {@code rawIndex}. */ public final class HotSpotConstantPool implements ConstantPool, MetaspaceHandleObject { @@ -252,25 +265,15 @@ private HotSpotResolvedObjectType getHolder() { * @return constant pool cache index */ private static int rawIndexToConstantPoolCacheIndex(int rawIndex, int opcode) { - int index; - if (opcode == Bytecodes.INVOKEDYNAMIC) { - index = rawIndex; - // See: ConstantPool::is_invokedynamic_index - if (index >= 0) { - throw new IllegalArgumentException("not an invokedynamic constant pool index " + index); - } + if (opcode == Bytecodes.INVOKEINTERFACE || + opcode == Bytecodes.INVOKEVIRTUAL || + opcode == Bytecodes.INVOKESPECIAL || + opcode == Bytecodes.INVOKESTATIC) { + return rawIndex + config().constantPoolCpCacheIndexTag; } else { - if (opcode == Bytecodes.INVOKEINTERFACE || - opcode == Bytecodes.INVOKEVIRTUAL || - opcode == Bytecodes.INVOKESPECIAL || - opcode == Bytecodes.INVOKESTATIC) { - index = rawIndex + config().constantPoolCpCacheIndexTag; - } else { - throw new IllegalArgumentException("unexpected opcode " + opcode); - - } + // Only the above 4 bytecodes use ConstantPoolCacheIndex + throw new IllegalArgumentException("unexpected opcode " + opcode); } - return index; } /** @@ -581,8 +584,8 @@ private static String argumentAsString(JavaConstant arg) { } @Override - public BootstrapMethodInvocation lookupBootstrapMethodInvocation(int rawCpi, int opcode) { - int cpi = opcode == -1 ? rawCpi : rawIndexToConstantPoolIndex(rawCpi, opcode); + public BootstrapMethodInvocation lookupBootstrapMethodInvocation(int index, int opcode) { + int cpi = opcode == -1 ? index : indyIndexConstantPoolIndex(index, opcode); final JvmConstant tag = getTagAt(cpi); switch (tag.name) { case "InvokeDynamic": @@ -685,13 +688,19 @@ public Signature lookupSignature(int cpi) { } @Override - public JavaConstant lookupAppendix(int cpi, int opcode) { + public JavaConstant lookupAppendix(int rawIndex, int opcode) { if (!Bytecodes.isInvoke(opcode)) { - throw new IllegalArgumentException("expected an invoke bytecode at " + cpi + ", got " + opcode); + throw new IllegalArgumentException("expected an invoke bytecode for " + rawIndex + ", got " + opcode); } - final int index = rawIndexToConstantPoolCacheIndex(cpi, opcode); - return compilerToVM().lookupAppendixInPool(this, index); + if (opcode == Bytecodes.INVOKEDYNAMIC) { + if (!isInvokedynamicIndex(rawIndex)) { + throw new IllegalArgumentException("expected a raw index for INVOKEDYNAMIC but got " + rawIndex); + } + return compilerToVM().lookupAppendixInPool(this, rawIndex); + } else { + return compilerToVM().lookupAppendixInPool(this, rawIndexToConstantPoolCacheIndex(rawIndex, opcode)); + } } /** @@ -709,19 +718,19 @@ private static JavaType getJavaType(final Object type) { } @Override - public JavaMethod lookupMethod(int cpi, int opcode, ResolvedJavaMethod caller) { - final int index = rawIndexToConstantPoolCacheIndex(cpi, opcode); - final HotSpotResolvedJavaMethod method = compilerToVM().lookupMethodInPool(this, index, (byte) opcode, (HotSpotResolvedJavaMethodImpl) caller); + public JavaMethod lookupMethod(int rawIndex, int opcode, ResolvedJavaMethod caller) { + final int cpci = rawIndexToConstantPoolCacheIndex(rawIndex, opcode); + final HotSpotResolvedJavaMethod method = compilerToVM().lookupMethodInPool(this, cpci, (byte) opcode, (HotSpotResolvedJavaMethodImpl) caller); if (method != null) { return method; } else { // Get the method's name and signature. - String name = getNameOf(index, opcode); - HotSpotSignature signature = new HotSpotSignature(runtime(), getSignatureOf(index, opcode)); + String name = getNameOf(cpci, opcode); + HotSpotSignature signature = new HotSpotSignature(runtime(), getSignatureOf(cpci, opcode)); if (opcode == Bytecodes.INVOKEDYNAMIC) { return new UnresolvedJavaMethod(name, signature, runtime().getMethodHandleClass()); } else { - final int klassIndex = getKlassRefIndexAt(index, opcode); + final int klassIndex = getKlassRefIndexAt(cpci, opcode); final Object type = compilerToVM().lookupKlassInPool(this, klassIndex); return new UnresolvedJavaMethod(name, signature, getJavaType(type)); } @@ -780,7 +789,6 @@ public JavaType lookupReferencedType(int rawIndex, int opcode) { @Override public JavaField lookupField(int rawIndex, ResolvedJavaMethod method, int opcode) { - final int cpi = compilerToVM().decodeFieldIndexToCPIndex(this, rawIndex); final int nameAndTypeIndex = getNameAndTypeRefIndexAt(rawIndex, opcode); final int typeIndex = getSignatureRefIndexAt(nameAndTypeIndex); String typeName = lookupUtf8(typeIndex); @@ -813,32 +821,23 @@ public JavaField lookupField(int rawIndex, ResolvedJavaMethod method, int opcode } /** - * Converts a raw index from the bytecodes to a constant pool index (not a cache index). + * Converts a raw index for the INVOKEDYNAMIC bytecode to a constant pool index. * * @param rawIndex index from the bytecode * - * @param opcode bytecode to convert the index for + * @param opcode bytecode to convert the index for. Must be INVOKEDYNAMIC. * * @return constant pool index */ - public int rawIndexToConstantPoolIndex(int rawIndex, int opcode) { + private int indyIndexConstantPoolIndex(int rawIndex, int opcode) { if (isInvokedynamicIndex(rawIndex)) { if (opcode != Bytecodes.INVOKEDYNAMIC) { throw new IllegalArgumentException("expected INVOKEDYNAMIC at " + rawIndex + ", got " + opcode); } return compilerToVM().decodeIndyIndexToCPIndex(this, rawIndex, false); + } else { + throw new IllegalArgumentException("expected a raw index for INVOKEDYNAMIC but got " + rawIndex); } - if (opcode == Bytecodes.INVOKEDYNAMIC) { - throw new IllegalArgumentException("unexpected INVOKEDYNAMIC at " + rawIndex); - } - if (opcode == Bytecodes.GETSTATIC || - opcode == Bytecodes.PUTSTATIC || - opcode == Bytecodes.GETFIELD || - opcode == Bytecodes.PUTFIELD) { - return compilerToVM().decodeFieldIndexToCPIndex(this, rawIndex); - } - int index = rawIndexToConstantPoolCacheIndex(rawIndex, opcode); - return compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index); } @Override diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java index 44cd1bc0d48..5a53de47f6a 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java @@ -172,19 +172,21 @@ interface BootstrapMethodInvocation { /** * Gets the details for invoking a bootstrap method associated with the - * {@code CONSTANT_Dynamic_info} or {@code CONSTANT_InvokeDynamic_info} pool entry {@code cpi} + * {@code CONSTANT_Dynamic_info} or {@code CONSTANT_InvokeDynamic_info} pool entry * in the constant pool. * - * @param cpi a constant pool index - * @param opcode the opcode of the instruction that has {@code cpi} as an operand or -1 if - * {@code cpi} was not decoded from an instruction stream - * @return the bootstrap method invocation details or {@code null} if the entry at {@code cpi} + * @param index if {@code opcode} is -1, {@code index} is a constant pool index. Otherwise {@code opcode} + * must be {@code Bytecodes.INVOKEDYNAMIC}, and {@code index} must be the operand of that + * opcode in the bytecode stream (i.e., a {@code rawIndex}). + * @param opcode must be {@code Bytecodes.INVOKEDYNAMIC}, or -1 if + * {@code index} was not decoded from a bytecode stream + * @return the bootstrap method invocation details or {@code null} if the entry specified by {@code index} * is not a {@code CONSTANT_Dynamic_info} or @{code CONSTANT_InvokeDynamic_info} * @throws IllegalArgumentException if the bootstrap method invocation makes use of * {@code java.lang.invoke.BootstrapCallInfo} * @jvms 4.7.23 The {@code BootstrapMethods} Attribute */ - default BootstrapMethodInvocation lookupBootstrapMethodInvocation(int cpi, int opcode) { + default BootstrapMethodInvocation lookupBootstrapMethodInvocation(int index, int opcode) { throw new UnsupportedOperationException(); } @@ -242,10 +244,9 @@ default BootstrapMethodInvocation lookupBootstrapMethodInvocation(int cpi, int o /** * Looks up the appendix at the specified index. * - * @param cpi the constant pool index - * @param opcode the opcode of the instruction for which the lookup is being performed or - * {@code -1} + * @param rawIndex index in the bytecode stream after the {@code opcode} (could be rewritten for some opcodes) + * @param opcode the opcode of the instruction for which the lookup is being performed * @return the appendix if it exists and is resolved or {@code null} */ - JavaConstant lookupAppendix(int cpi, int opcode); + JavaConstant lookupAppendix(int rawIndex, int opcode); } diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestDynamicConstant.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestDynamicConstant.java index 05f44fcdb77..c69c4e5a345 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestDynamicConstant.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestDynamicConstant.java @@ -271,8 +271,8 @@ private static void assertNoEagerConstantResolution(Class testClass, Constant private static void assertLookupBMIDoesNotInvokeBM(MetaAccessProvider metaAccess, Class testClass) throws Exception { ResolvedJavaMethod shouldNotBeCalled = metaAccess.lookupJavaMethod(testClass.getDeclaredMethod("shouldNotBeCalled")); ConstantPool cp = shouldNotBeCalled.getConstantPool(); - int cpi = getFirstInvokedynamicOperand(shouldNotBeCalled); - BootstrapMethodInvocation bmi = cp.lookupBootstrapMethodInvocation(cpi, INVOKEDYNAMIC); + int rawIndex = getFirstInvokedynamicOperand(shouldNotBeCalled); + BootstrapMethodInvocation bmi = cp.lookupBootstrapMethodInvocation(rawIndex, INVOKEDYNAMIC); Assert.assertEquals(bmi.getName(), "do_shouldNotBeCalled"); Assert.assertEquals(bmi.getMethod().getName(), "shouldNotBeCalledBSM"); } @@ -408,8 +408,8 @@ private static int getFirstInvokedynamicOperand(ResolvedJavaMethod method) { * Ensures that loadReferencedType for an invokedynamic call site does not throw an exception. */ private static void testLoadReferencedType(ResolvedJavaMethod method, ConstantPool cp) { - int cpi = getFirstInvokedynamicOperand(method); - cp.loadReferencedType(cpi, INVOKEDYNAMIC, false); + int rawIndex = getFirstInvokedynamicOperand(method); + cp.loadReferencedType(rawIndex, INVOKEDYNAMIC, false); } // @formatter:off diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantPoolTest.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantPoolTest.java index 1241c33f24b..26fcedb64d4 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantPoolTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantPoolTest.java @@ -37,9 +37,15 @@ */ package jdk.vm.ci.runtime.test; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodHandles.Lookup; +import java.lang.invoke.MethodType; + import org.testng.Assert; import org.testng.annotations.Test; +import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaField; import jdk.vm.ci.meta.JavaMethod; import jdk.vm.ci.meta.MetaAccessProvider; @@ -82,9 +88,12 @@ static Object cloneObjectArray(Object[] arr) { return arr.clone(); } - public static final int ALOAD_0 = 42; // 0x2A - public static final int GETSTATIC = 178; // 0xB2 - public static final int INVOKEVIRTUAL = 182; // 0xB6 + public static final int ICONST_0 = 3; + public static final int ALOAD_0 = 42; + public static final int ALOAD_1 = 43; + public static final int GETSTATIC = 178; + public static final int INVOKEVIRTUAL = 182; + public static final int INVOKEDYNAMIC = 186; public static int beU2(byte[] data, int bci) { return ((data[bci] & 0xff) << 8) | (data[bci + 1] & 0xff); @@ -94,6 +103,10 @@ public static int beU1(byte[] data, int bci) { return data[bci] & 0xff; } + public static int beS4(byte[] data, int bci) { + return (data[bci] << 24) | ((data[bci + 1] & 0xff) << 16) | ((data[bci + 2] & 0xff) << 8) | (data[bci + 3] & 0xff); + } + @Test public void lookupArrayCloneMethodTest() throws Exception { MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess(); @@ -138,4 +151,86 @@ public void lookupFieldTest() throws Exception { JavaField field = m.getConstantPool().lookupField(rawIndex, m, GETSTATIC); Assert.assertEquals("someStaticField", field.getName(), "Wrong field name; rawIndex = " + rawIndex + ";"); } + + static String concatString1(String a, String b) { + return a + b; + } + + static String concatString2(String a, String b) { + return a + b; + } + + static void invokeHandle(MethodHandle mh) throws Throwable { + mh.invokeExact(0); + } + + static void intFunc(int t) {} + + @Test + public void lookupAppendixTest() throws Throwable { + // We want at least two indy bytecodes -- with a single indy, the rawIndex is -1, + // or 0xffffffff. Even if we load it with the wrong endianness, it will still come + // "correctly" out as -1. + concatString1("aaa", "bbb"); // force the indy to be resolved + concatString2("aaa", "bbb"); // force the indy to be resolved + + MethodHandles.Lookup lookup = MethodHandles.lookup(); + MethodType mt = MethodType.methodType(void.class, int.class); + MethodHandle mh = lookup.findStatic(ConstantPoolTest.class, "intFunc", mt); + invokeHandle(mh); + + lookupAppendixTest_dynamic("concatString1"); + lookupAppendixTest_dynamic("concatString2"); + lookupAppendixTest_virtual(); + } + + public void lookupAppendixTest_dynamic(String methodName) throws Exception { + MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess(); + ResolvedJavaType type = metaAccess.lookupJavaType(ConstantPoolTest.class); + Signature methodSig = metaAccess.parseMethodDescriptor("(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"); + ResolvedJavaMethod m = type.findMethod(methodName, methodSig); + Assert.assertNotNull(m); + + // Expected: + // aload_0; + // aload_1; + // invokedynamic ...StringConcatFactory.makeConcatWithConstants... + byte[] bytecode = m.getCode(); + Assert.assertNotNull(bytecode); + Assert.assertEquals(8, bytecode.length); + Assert.assertEquals(ALOAD_0, beU1(bytecode, 0)); + Assert.assertEquals(ALOAD_1, beU1(bytecode, 1)); + Assert.assertEquals(INVOKEDYNAMIC, beU1(bytecode, 2)); + + // Note: internally HotSpot stores the indy index as a native int32, but m.getCode() byte-swaps all such + // indices so they appear to be big-endian. + int rawIndex = beS4(bytecode, 3); + JavaConstant constant = m.getConstantPool().lookupAppendix(rawIndex, INVOKEDYNAMIC); + Assert.assertTrue(constant.toString().startsWith("Object["), "wrong appendix: " + constant); + } + + public void lookupAppendixTest_virtual() throws Exception { + MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess(); + ResolvedJavaType type = metaAccess.lookupJavaType(ConstantPoolTest.class); + Signature methodSig = metaAccess.parseMethodDescriptor("(Ljava/lang/invoke/MethodHandle;)V"); + ResolvedJavaMethod m = type.findMethod("invokeHandle", methodSig); + Assert.assertNotNull(m); + + // Expected + // aload_0 + // iconst_0 + // invokevirtual #rawIndex // Method java/lang/invoke/MethodHandle.invokeExact:(I)V + byte[] bytecode = m.getCode(); + Assert.assertNotNull(bytecode); + Assert.assertEquals(6, bytecode.length); + Assert.assertEquals(ALOAD_0, beU1(bytecode, 0)); + Assert.assertEquals(ICONST_0, beU1(bytecode, 1)); + Assert.assertEquals(INVOKEVIRTUAL, beU1(bytecode, 2)); + + int rawIndex = beU2(bytecode, 3); + //System.out.println("rawIndex = " + rawIndex); + JavaConstant constant = m.getConstantPool().lookupAppendix(rawIndex, INVOKEVIRTUAL); + //System.out.println("constant = " + constant); + Assert.assertTrue(constant.toString().startsWith("Object["), "wrong appendix: " + constant); + } } From 891c3f4cca97b90982b7e58b08b4a146842d9a9d Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 18 Aug 2023 05:51:05 +0000 Subject: [PATCH 104/162] 8307356: Metaspace: simplify BinList handling Reviewed-by: rkennke, coleenp --- .../share/memory/metaspace/binList.hpp | 60 ++++++++++--------- .../share/memory/metaspace/blockTree.hpp | 3 +- .../share/memory/metaspace/freeBlocks.cpp | 5 +- .../share/memory/metaspace/metaspaceArena.cpp | 54 ++++++++++------- .../share/memory/metaspace/metaspaceArena.hpp | 1 + .../memory/metaspace/metaspaceCommon.cpp | 18 ------ .../memory/metaspace/metaspaceCommon.hpp | 26 ++++---- test/hotspot/gtest/metaspace/test_binlist.cpp | 39 +++++------- .../gtest/metaspace/test_metaspacearena.cpp | 8 +-- .../metaspace/test_metaspacearena_stress.cpp | 9 +-- test/hotspot/jtreg/TEST.groups | 2 - 11 files changed, 106 insertions(+), 119 deletions(-) diff --git a/src/hotspot/share/memory/metaspace/binList.hpp b/src/hotspot/share/memory/metaspace/binList.hpp index 6d3a25f701a..76cd9e155aa 100644 --- a/src/hotspot/share/memory/metaspace/binList.hpp +++ b/src/hotspot/share/memory/metaspace/binList.hpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020 SAP SE. All rights reserved. + * Copyright (c) 2023 Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,12 +39,8 @@ namespace metaspace { // (only a few words). It is used to manage deallocated blocks - see // class FreeBlocks. -// Memory blocks are kept in linked lists. Each list -// contains blocks of only one size. There is a list for blocks of two words, -// for blocks of three words, etc. The list heads are kept in a vector, -// ordered by block size. +// Memory blocks are kept in a vector of linked lists of equi-sized blocks: // - // wordsize // // +---+ +---+ +---+ +---+ @@ -73,32 +70,28 @@ namespace metaspace { // This structure is a bit expensive in memory costs (we pay one pointer per managed // block size) so we only use it for a small number of sizes. -template +template class BinListImpl { struct Block { Block* const _next; - const size_t _word_size; - Block(Block* next, size_t word_size) : - _next(next), - _word_size(word_size) - {} + Block(Block* next) : _next(next) {} }; -#define BLOCK_FORMAT "Block @" PTR_FORMAT ": size: " SIZE_FORMAT ", next: " PTR_FORMAT -#define BLOCK_FORMAT_ARGS(b) p2i(b), (b)->_word_size, p2i((b)->_next) +#define BLOCK_FORMAT "Block @" PTR_FORMAT ": size: " SIZE_FORMAT ", next: " PTR_FORMAT +#define BLOCK_FORMAT_ARGS(b, sz) p2i(b), (sz), p2i((b)->_next) - // Smallest block size must be large enough to hold a Block structure. - STATIC_ASSERT(smallest_word_size * sizeof(MetaWord) >= sizeof(Block)); + // Block size must be exactly one word size. + STATIC_ASSERT(sizeof(Block) == BytesPerWord); STATIC_ASSERT(num_lists > 0); public: // Minimal word size a block must have to be manageable by this structure. - const static size_t MinWordSize = smallest_word_size; + const static size_t MinWordSize = 1; // Maximal (incl) word size a block can have to be manageable by this structure. - const static size_t MaxWordSize = MinWordSize + num_lists - 1; + const static size_t MaxWordSize = num_lists; private: @@ -106,15 +99,17 @@ class BinListImpl { MemRangeCounter _counter; + // Given a word size, returns the index of the list holding blocks of that size static int index_for_word_size(size_t word_size) { int index = (int)(word_size - MinWordSize); assert(index >= 0 && index < num_lists, "Invalid index %d", index); return index; } + // Given an index of a list, return the word size that list serves static size_t word_size_for_index(int index) { assert(index >= 0 && index < num_lists, "Invalid index %d", index); - return MinWordSize + index; + return index + MinWordSize; } // Search the range [index, _num_lists) for the smallest non-empty list. Returns -1 on fail. @@ -127,6 +122,19 @@ class BinListImpl { return i2 == num_lists ? -1 : i2; } +#ifdef ASSERT + static const uintptr_t canary = 0xFFEEFFEE; + static void write_canary(MetaWord* p, size_t word_size) { + if (word_size > 1) { // 1-word-sized blocks have no space for a canary + ((uintptr_t*)p)[word_size - 1] = canary; + } + } + static bool check_canary(const Block* b, size_t word_size) { + return word_size == 1 || // 1-word-sized blocks have no space for a canary + ((const uintptr_t*)b)[word_size - 1] == canary; + } +#endif + public: BinListImpl() { @@ -138,9 +146,10 @@ class BinListImpl { void add_block(MetaWord* p, size_t word_size) { assert(word_size >= MinWordSize && word_size <= MaxWordSize, "bad block size"); + DEBUG_ONLY(write_canary(p, word_size);) const int index = index_for_word_size(word_size); Block* old_head = _blocks[index]; - Block* new_head = new(p)Block(old_head, word_size); + Block* new_head = new (p) Block(old_head); _blocks[index] = new_head; _counter.add(word_size); } @@ -156,9 +165,8 @@ class BinListImpl { Block* b = _blocks[index]; const size_t real_word_size = word_size_for_index(index); assert(b != nullptr, "Sanity"); - assert(b->_word_size >= word_size && - b->_word_size == real_word_size, - "bad block size in list[%d] (" BLOCK_FORMAT ")", index, BLOCK_FORMAT_ARGS(b)); + assert(check_canary(b, real_word_size), + "bad block in list[%d] (" BLOCK_FORMAT ")", index, BLOCK_FORMAT_ARGS(b, real_word_size)); _blocks[index] = b->_next; _counter.sub(real_word_size); *p_real_word_size = real_word_size; @@ -181,12 +189,10 @@ class BinListImpl { void verify() const { MemRangeCounter local_counter; for (int i = 0; i < num_lists; i++) { - const size_t s = MinWordSize + i; + const size_t s = word_size_for_index(i); int pos = 0; for (Block* b = _blocks[i]; b != nullptr; b = b->_next, pos++) { - assert(b->_word_size == s, - "bad block size in list[%d] at pos %d (" BLOCK_FORMAT ")", - i, pos, BLOCK_FORMAT_ARGS(b)); + assert(check_canary(b, s), ""); local_counter.add(s); } } @@ -196,7 +202,7 @@ class BinListImpl { }; -typedef BinListImpl<2, 32> BinList32; +typedef BinListImpl<32> BinList32; } // namespace metaspace diff --git a/src/hotspot/share/memory/metaspace/blockTree.hpp b/src/hotspot/share/memory/metaspace/blockTree.hpp index b9713f59a76..c5dd48926ac 100644 --- a/src/hotspot/share/memory/metaspace/blockTree.hpp +++ b/src/hotspot/share/memory/metaspace/blockTree.hpp @@ -41,8 +41,7 @@ namespace metaspace { // memory blocks themselves are the nodes, with the block size being the key. // // We store node pointer information in these blocks when storing them. That -// imposes a minimum size to the managed memory blocks. -// See get_raw_word_size_for_requested_word_size() (msCommon.hpp). +// imposes a minimum size to the managed memory blocks (1 word) // // We want to manage many memory blocks of the same size, but we want // to prevent the tree from blowing up and degenerating into a list. Therefore diff --git a/src/hotspot/share/memory/metaspace/freeBlocks.cpp b/src/hotspot/share/memory/metaspace/freeBlocks.cpp index df18529750e..b6a281f0db7 100644 --- a/src/hotspot/share/memory/metaspace/freeBlocks.cpp +++ b/src/hotspot/share/memory/metaspace/freeBlocks.cpp @@ -31,7 +31,6 @@ namespace metaspace { void FreeBlocks::add_block(MetaWord* p, size_t word_size) { - assert(word_size >= MinWordSize, "sanity (" SIZE_FORMAT ")", word_size); if (word_size > MaxSmallBlocksWordSize) { _tree.add_block(p, word_size); } else { @@ -40,8 +39,6 @@ void FreeBlocks::add_block(MetaWord* p, size_t word_size) { } MetaWord* FreeBlocks::remove_block(size_t requested_word_size) { - assert(requested_word_size >= MinWordSize, - "requested_word_size too small (" SIZE_FORMAT ")", requested_word_size); size_t real_size = 0; MetaWord* p = nullptr; if (requested_word_size > MaxSmallBlocksWordSize) { @@ -53,7 +50,7 @@ MetaWord* FreeBlocks::remove_block(size_t requested_word_size) { // Blocks which are larger than a certain threshold are split and // the remainder is handed back to the manager. const size_t waste = real_size - requested_word_size; - if (waste > MinWordSize) { + if (waste >= MinWordSize) { add_block(p + requested_word_size, waste); } } diff --git a/src/hotspot/share/memory/metaspace/metaspaceArena.cpp b/src/hotspot/share/memory/metaspace/metaspaceArena.cpp index ce7445260b8..64c2cc0b2b5 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceArena.cpp +++ b/src/hotspot/share/memory/metaspace/metaspaceArena.cpp @@ -60,7 +60,7 @@ chunklevel_t MetaspaceArena::next_chunk_level() const { void MetaspaceArena::salvage_chunk(Metachunk* c) { assert_lock_strong(lock()); size_t remaining_words = c->free_below_committed_words(); - if (remaining_words > FreeBlocks::MinWordSize) { + if (remaining_words >= FreeBlocks::MinWordSize) { UL2(trace, "salvaging chunk " METACHUNK_FULL_FORMAT ".", METACHUNK_FULL_FORMAT_ARGS(c)); @@ -101,6 +101,10 @@ Metachunk* MetaspaceArena::allocate_new_chunk(size_t requested_word_size) { } void MetaspaceArena::add_allocation_to_fbl(MetaWord* p, size_t word_size) { + assert(p != nullptr, "p is null"); + assert_is_aligned_metaspace_pointer(p); + assert(word_size > 0, "zero sized"); + if (_fbl == nullptr) { _fbl = new FreeBlocks(); // Create only on demand } @@ -131,7 +135,7 @@ MetaspaceArena::~MetaspaceArena() { #ifdef ASSERT SOMETIMES(verify();) if (Settings::use_allocation_guard()) { - SOMETIMES(verify_allocation_guards();) + verify_allocation_guards(); } #endif @@ -224,15 +228,16 @@ MetaWord* MetaspaceArena::allocate(size_t requested_word_size) { UL2(trace, "requested " SIZE_FORMAT " words.", requested_word_size); MetaWord* p = nullptr; - const size_t raw_word_size = get_raw_word_size_for_requested_word_size(requested_word_size); + const size_t aligned_word_size = get_raw_word_size_for_requested_word_size(requested_word_size); // Before bothering the arena proper, attempt to re-use a block from the free blocks list if (_fbl != nullptr && !_fbl->is_empty()) { - p = _fbl->remove_block(raw_word_size); + p = _fbl->remove_block(aligned_word_size); if (p != nullptr) { DEBUG_ONLY(InternalStats::inc_num_allocs_from_deallocated_blocks();) - UL2(trace, "taken from fbl (now: %d, " SIZE_FORMAT ").", - _fbl->count(), _fbl->total_size()); + UL2(trace, "returning " PTR_FORMAT " - taken from fbl (now: %d, " SIZE_FORMAT ").", + p2i(p), _fbl->count(), _fbl->total_size()); + assert_is_aligned_metaspace_pointer(p); // Note: free blocks in freeblock dictionary still count as "used" as far as statistics go; // therefore we have no need to adjust any usage counters (see epilogue of allocate_inner()) // and can just return here. @@ -241,7 +246,7 @@ MetaWord* MetaspaceArena::allocate(size_t requested_word_size) { } // Primary allocation - p = allocate_inner(requested_word_size); + p = allocate_inner(aligned_word_size); #ifdef ASSERT // Fence allocation @@ -264,11 +269,11 @@ MetaWord* MetaspaceArena::allocate(size_t requested_word_size) { } // Allocate from the arena proper, once dictionary allocations and fencing are sorted out. -MetaWord* MetaspaceArena::allocate_inner(size_t requested_word_size) { +MetaWord* MetaspaceArena::allocate_inner(size_t word_size) { assert_lock_strong(lock()); + assert_is_aligned(word_size, metaspace::AllocationAlignmentWordSize); - const size_t raw_word_size = get_raw_word_size_for_requested_word_size(requested_word_size); MetaWord* p = nullptr; bool current_chunk_too_small = false; bool commit_failure = false; @@ -279,8 +284,8 @@ MetaWord* MetaspaceArena::allocate_inner(size_t requested_word_size) { // If the current chunk is too small to hold the requested size, attempt to enlarge it. // If that fails, retire the chunk. - if (current_chunk()->free_words() < raw_word_size) { - if (!attempt_enlarge_current_chunk(raw_word_size)) { + if (current_chunk()->free_words() < word_size) { + if (!attempt_enlarge_current_chunk(word_size)) { current_chunk_too_small = true; } else { DEBUG_ONLY(InternalStats::inc_num_chunks_enlarged();) @@ -292,15 +297,15 @@ MetaWord* MetaspaceArena::allocate_inner(size_t requested_word_size) { // hit a limit (either GC threshold or MaxMetaspaceSize). In that case retire the // chunk. if (!current_chunk_too_small) { - if (!current_chunk()->ensure_committed_additional(raw_word_size)) { - UL2(info, "commit failure (requested size: " SIZE_FORMAT ")", raw_word_size); + if (!current_chunk()->ensure_committed_additional(word_size)) { + UL2(info, "commit failure (requested size: " SIZE_FORMAT ")", word_size); commit_failure = true; } } // Allocate from the current chunk. This should work now. if (!current_chunk_too_small && !commit_failure) { - p = current_chunk()->allocate(raw_word_size); + p = current_chunk()->allocate(word_size); assert(p != nullptr, "Allocation from chunk failed."); } } @@ -310,12 +315,12 @@ MetaWord* MetaspaceArena::allocate_inner(size_t requested_word_size) { assert(current_chunk() == nullptr || current_chunk_too_small || commit_failure, "Sanity"); - Metachunk* new_chunk = allocate_new_chunk(raw_word_size); + Metachunk* new_chunk = allocate_new_chunk(word_size); if (new_chunk != nullptr) { UL2(debug, "allocated new chunk " METACHUNK_FORMAT " for requested word size " SIZE_FORMAT ".", - METACHUNK_FORMAT_ARGS(new_chunk), requested_word_size); + METACHUNK_FORMAT_ARGS(new_chunk), word_size); - assert(new_chunk->free_below_committed_words() >= raw_word_size, "Sanity"); + assert(new_chunk->free_below_committed_words() >= word_size, "Sanity"); // We have a new chunk. Before making it the current chunk, retire the old one. if (current_chunk() != nullptr) { @@ -326,10 +331,10 @@ MetaWord* MetaspaceArena::allocate_inner(size_t requested_word_size) { _chunks.add(new_chunk); // Now, allocate from that chunk. That should work. - p = current_chunk()->allocate(raw_word_size); + p = current_chunk()->allocate(word_size); assert(p != nullptr, "Allocation from chunk failed."); } else { - UL2(info, "failed to allocate new chunk for requested word size " SIZE_FORMAT ".", requested_word_size); + UL2(info, "failed to allocate new chunk for requested word size " SIZE_FORMAT ".", word_size); } } @@ -337,7 +342,7 @@ MetaWord* MetaspaceArena::allocate_inner(size_t requested_word_size) { InternalStats::inc_num_allocs_failed_limit(); } else { DEBUG_ONLY(InternalStats::inc_num_allocs();) - _total_used_words_counter->increment_by(raw_word_size); + _total_used_words_counter->increment_by(word_size); } SOMETIMES(verify_locked();) @@ -349,6 +354,9 @@ MetaWord* MetaspaceArena::allocate_inner(size_t requested_word_size) { _chunks.count(), METACHUNK_FULL_FORMAT_ARGS(current_chunk())); UL2(trace, "returning " PTR_FORMAT ".", p2i(p)); } + + assert_is_aligned_metaspace_pointer(p); + return p; } @@ -365,7 +373,13 @@ void MetaspaceArena::deallocate_locked(MetaWord* p, size_t word_size) { UL2(trace, "deallocating " PTR_FORMAT ", word size: " SIZE_FORMAT ".", p2i(p), word_size); + // Only blocks that had been allocated via MetaspaceArena::allocate(size) must be handed in + // to MetaspaceArena::deallocate(), and only with the same size that had been original used for allocation. + // Therefore the pointer must be aligned correctly, and size can be alignment-adjusted (the latter + // only matters on 32-bit): + assert_is_aligned_metaspace_pointer(p); size_t raw_word_size = get_raw_word_size_for_requested_word_size(word_size); + add_allocation_to_fbl(p, raw_word_size); SOMETIMES(verify_locked();) diff --git a/src/hotspot/share/memory/metaspace/metaspaceArena.hpp b/src/hotspot/share/memory/metaspace/metaspaceArena.hpp index 925d05fc962..b77e943ee9d 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceArena.hpp +++ b/src/hotspot/share/memory/metaspace/metaspaceArena.hpp @@ -119,6 +119,7 @@ class MetaspaceArena : public CHeapObj { // Two eyecatchers to easily spot a corrupted _next pointer const uintx _eye1; const Fence* const _next; + NOT_LP64(uintx _dummy;) const uintx _eye2; public: Fence(const Fence* next) : _eye1(EyeCatcher), _next(next), _eye2(EyeCatcher) {} diff --git a/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp b/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp index 8a8c43e604a..881a811fbed 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp +++ b/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp @@ -168,23 +168,5 @@ void print_number_of_classes(outputStream* out, uintx classes, uintx classes_sha } } -// Given a net allocation word size, return the raw word size we actually allocate. -// Note: externally visible for gtests. -//static -size_t get_raw_word_size_for_requested_word_size(size_t word_size) { - size_t byte_size = word_size * BytesPerWord; - - // Deallocated metablocks are kept in a binlist which limits their minimal - // size to at least the size of a binlist item (2 words). - byte_size = MAX2(byte_size, FreeBlocks::MinWordSize * BytesPerWord); - - // Metaspace allocations are aligned to word size. - byte_size = align_up(byte_size, AllocationAlignmentByteSize); - - size_t raw_word_size = byte_size / BytesPerWord; - assert(raw_word_size * BytesPerWord == byte_size, "Sanity"); - return raw_word_size; -} - } // namespace metaspace diff --git a/src/hotspot/share/memory/metaspace/metaspaceCommon.hpp b/src/hotspot/share/memory/metaspace/metaspaceCommon.hpp index a13ef1b3251..eae75e8194c 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceCommon.hpp +++ b/src/hotspot/share/memory/metaspace/metaspaceCommon.hpp @@ -38,24 +38,27 @@ namespace metaspace { // Metaspace allocation alignment: -// 1) Metaspace allocations have to be aligned such that 64bit values are aligned -// correctly. +// Metaspace allocations have to be aligned such that 64-bit values are aligned +// correctly. We currently don't hold members with a larger alignment requirement +// than 64-bit inside MetaData, so 8-byte alignment is enough. // -// 2) Klass* structures allocated from Metaspace have to be aligned to KlassAlignmentInBytes. +// Klass* structures need to be aligned to KlassAlignmentInBytes, but since that is +// 64-bit, we don't need special handling for allocating Klass*. // -// At the moment LogKlassAlignmentInBytes is 3, so KlassAlignmentInBytes == 8, -// so (1) and (2) can both be fulfilled with an alignment of 8. Should we increase -// KlassAlignmentInBytes at any time this will increase the necessary alignment as well. In -// that case we may think about introducing a separate alignment just for the class space -// since that alignment would only be needed for Klass structures. +// On 64-bit platforms, we align to word size; on 32-bit, we align to two words. static const size_t AllocationAlignmentByteSize = 8; STATIC_ASSERT(AllocationAlignmentByteSize == (size_t)KlassAlignmentInBytes); static const size_t AllocationAlignmentWordSize = AllocationAlignmentByteSize / BytesPerWord; -// Returns the raw word size allocated for a given net allocation -size_t get_raw_word_size_for_requested_word_size(size_t word_size); +// Returns the raw word size allocated for a given net allocation. This only matters on 32-bit, where +// allocations have to be 64-bit aligned too and therefore must be 2-word-aligned. +inline size_t get_raw_word_size_for_requested_word_size(size_t word_size) { + LP64_ONLY(STATIC_ASSERT(AllocationAlignmentWordSize == 1)); // rewrite if this does not hold true anymore + return LP64_ONLY(word_size) // no-op on 64-bit + NOT_LP64(align_up(word_size, AllocationAlignmentWordSize)); +} // Utility functions @@ -81,8 +84,11 @@ void print_percentage(outputStream* st, size_t total, size_t part); assert(is_aligned((value), (alignment)), \ SIZE_FORMAT_X " is not aligned to " \ SIZE_FORMAT_X, (size_t)(uintptr_t)value, (size_t)(alignment)) +#define assert_is_aligned_metaspace_pointer(p) \ + assert_is_aligned((p), metaspace::AllocationAlignmentByteSize); #else #define assert_is_aligned(value, alignment) +#define assert_is_aligned_metaspace_pointer(pointer) #endif // Pretty printing helpers diff --git a/test/hotspot/gtest/metaspace/test_binlist.cpp b/test/hotspot/gtest/metaspace/test_binlist.cpp index c526d4cd492..fd211a2eb8d 100644 --- a/test/hotspot/gtest/metaspace/test_binlist.cpp +++ b/test/hotspot/gtest/metaspace/test_binlist.cpp @@ -46,7 +46,6 @@ using metaspace::MemRangeCounter; template struct BinListBasicTest { - static const size_t minws; static const size_t maxws; static void basic_test() { @@ -57,7 +56,7 @@ struct BinListBasicTest { MetaWord arr[1000]; - size_t innocous_size = minws + ((maxws - minws) / 2); + size_t innocous_size = MAX2((size_t)1, maxws / 2); // Try to get a block from an empty list. size_t real_size = 4711; @@ -88,8 +87,8 @@ struct BinListBasicTest { MetaWord arr[1000]; - for (size_t s1 = minws; s1 <= maxws; s1++) { - for (size_t s2 = minws; s2 <= maxws; s2++) { + for (size_t s1 = 1; s1 <= maxws; s1++) { + for (size_t s2 = 1; s2 <= maxws; s2++) { bl.add_block(arr, s1); CHECK_BL_CONTENT(bl, 1, s1); @@ -108,7 +107,7 @@ struct BinListBasicTest { CHECK_BL_CONTENT(bl, 1, s1); DEBUG_ONLY(bl.verify();) // drain bl - p = bl.remove_block(minws, &real_size); + p = bl.remove_block(1, &real_size); EXPECT_EQ(p, arr); EXPECT_EQ((size_t)s1, real_size); CHECK_BL_CONTENT(bl, 0, 0); @@ -129,7 +128,7 @@ struct BinListBasicTest { ASSERT_EQ(cnt[1].total_size(), bl[1].total_size()); FeederBuffer fb(1024); - RandSizeGenerator rgen(minws, maxws + 1); + RandSizeGenerator rgen(1, maxws + 1); // feed all int which = 0; @@ -184,10 +183,10 @@ struct BinListBasicTest { while (bl[which].is_empty() == false) { size_t real_size = 4711; - MetaWord* p = bl[which].remove_block(minws, &real_size); + MetaWord* p = bl[which].remove_block(1, &real_size); ASSERT_NE(p, (MetaWord*) NULL); - ASSERT_GE(real_size, minws); + ASSERT_GE(real_size, (size_t)1); ASSERT_TRUE(fb.is_valid_range(p, real_size)); // This must hold true since we always return the smallest fit. @@ -205,24 +204,16 @@ struct BinListBasicTest { } }; -template const size_t BinListBasicTest::minws = BINLISTTYPE::MinWordSize; template const size_t BinListBasicTest::maxws = BINLISTTYPE::MaxWordSize; -TEST_VM(metaspace, BinList_basic_8) { BinListBasicTest< BinListImpl<2, 8> >::basic_test(); } -TEST_VM(metaspace, BinList_basic_16) { BinListBasicTest< BinListImpl<2, 16> >::basic_test(); } +TEST_VM(metaspace, BinList_basic_1) { BinListBasicTest< BinListImpl<1> >::basic_test(); } +TEST_VM(metaspace, BinList_basic_8) { BinListBasicTest< BinListImpl<8> >::basic_test(); } TEST_VM(metaspace, BinList_basic_32) { BinListBasicTest::basic_test(); } -TEST_VM(metaspace, BinList_basic_1331) { BinListBasicTest< BinListImpl<13, 31> >::basic_test(); } -TEST_VM(metaspace, BinList_basic_131) { BinListBasicTest< BinListImpl<13, 1> >::basic_test(); } -TEST_VM(metaspace, BinList_basic2_8) { BinListBasicTest< BinListImpl<2, 8> >::basic_test_2(); } -TEST_VM(metaspace, BinList_basic2_16) { BinListBasicTest< BinListImpl<2, 16> >::basic_test_2(); } -TEST_VM(metaspace, BinList_basic2_32) { BinListBasicTest::basic_test_2(); } -TEST_VM(metaspace, BinList_basic2_1331) { BinListBasicTest< BinListImpl<13, 31> >::basic_test_2(); } -TEST_VM(metaspace, BinList_basic2_131) { BinListBasicTest< BinListImpl<13, 1> >::basic_test_2(); } - -TEST_VM(metaspace, BinList_random_test_8) { BinListBasicTest< BinListImpl<2, 8> >::random_test(); } -TEST_VM(metaspace, BinList_random_test_16) { BinListBasicTest< BinListImpl<2, 16> >::random_test(); } -TEST_VM(metaspace, BinList_random_test_32) { BinListBasicTest::random_test(); } -TEST_VM(metaspace, BinList_random_test_1331) { BinListBasicTest< BinListImpl<13, 31> >::random_test(); } -TEST_VM(metaspace, BinList_random_test_131) { BinListBasicTest< BinListImpl<13, 1> >::random_test(); } +TEST_VM(metaspace, BinList_basic_2_1) { BinListBasicTest< BinListImpl<1> >::basic_test_2(); } +TEST_VM(metaspace, BinList_basic_2_8) { BinListBasicTest< BinListImpl<8> >::basic_test_2(); } +TEST_VM(metaspace, BinList_basic_2_32) { BinListBasicTest::basic_test_2(); } +TEST_VM(metaspace, BinList_basic_rand_1) { BinListBasicTest< BinListImpl<1> >::random_test(); } +TEST_VM(metaspace, BinList_basic_rand_8) { BinListBasicTest< BinListImpl<8> >::random_test(); } +TEST_VM(metaspace, BinList_basic_rand_32) { BinListBasicTest::random_test(); } diff --git a/test/hotspot/gtest/metaspace/test_metaspacearena.cpp b/test/hotspot/gtest/metaspace/test_metaspacearena.cpp index 8c1a21cf6dd..c81a4cb6b22 100644 --- a/test/hotspot/gtest/metaspace/test_metaspacearena.cpp +++ b/test/hotspot/gtest/metaspace/test_metaspacearena.cpp @@ -41,6 +41,7 @@ #include "metaspaceGtestContexts.hpp" #include "metaspaceGtestRangeHelpers.hpp" +using metaspace::AllocationAlignmentByteSize; using metaspace::ArenaGrowthPolicy; using metaspace::CommitLimiter; using metaspace::InternalStats; @@ -50,11 +51,6 @@ using metaspace::SizeAtomicCounter; using metaspace::Settings; using metaspace::ArenaStats; -// See metaspaceArena.cpp : needed for predicting commit sizes. -namespace metaspace { - extern size_t get_raw_word_size_for_requested_word_size(size_t net_word_size); -} - class MetaspaceArenaTestHelper { MetaspaceGtestContext& _context; @@ -179,7 +175,7 @@ class MetaspaceArenaTestHelper { ASSERT_EQ(capacity, capacity2); } else { // Allocation succeeded. Should be correctly aligned. - ASSERT_TRUE(is_aligned(p, sizeof(MetaWord))); + ASSERT_TRUE(is_aligned(p, AllocationAlignmentByteSize)); // used: may go up or may not (since our request may have been satisfied from the freeblocklist // whose content already counts as used). // committed: may go up, may not diff --git a/test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp b/test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp index 50c5d0bc0e1..f9500ed8ce1 100644 --- a/test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp +++ b/test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp @@ -38,6 +38,7 @@ #include "metaspaceGtestContexts.hpp" #include "metaspaceGtestSparseArray.hpp" +using metaspace::AllocationAlignmentByteSize; using metaspace::ArenaGrowthPolicy; using metaspace::ChunkManager; using metaspace::IntCounter; @@ -52,11 +53,6 @@ static bool fifty_fifty() { return IntRange(100).random_value() < 50; } -// See metaspaceArena.cpp : needed for predicting commit sizes. -namespace metaspace { - extern size_t get_raw_word_size_for_requested_word_size(size_t net_word_size); -} - // A MetaspaceArenaTestBed contains a single MetaspaceArena and its lock. // It keeps track of allocations done from this MetaspaceArena. class MetaspaceArenaTestBed : public CHeapObj { @@ -179,7 +175,8 @@ class MetaspaceArenaTestBed : public CHeapObj { size_t word_size = 1 + _allocation_range.random_value(); MetaWord* p = _arena->allocate(word_size); if (p != NULL) { - EXPECT_TRUE(is_aligned(p, sizeof(MetaWord))); + EXPECT_TRUE(is_aligned(p, AllocationAlignmentByteSize)); + allocation_t* a = NEW_C_HEAP_OBJ(allocation_t, mtInternal); a->word_size = word_size; a->p = p; diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index c458ae7ed44..be6d9fdeddf 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -384,8 +384,6 @@ tier1_runtime = \ -runtime/memory/ReserveMemory.java \ -runtime/Metaspace/FragmentMetaspace.java \ -runtime/Metaspace/FragmentMetaspaceSimple.java \ - -runtime/Metaspace/elastic/TestMetaspaceAllocationMT1.java \ - -runtime/Metaspace/elastic/TestMetaspaceAllocationMT2.java \ -runtime/MirrorFrame/Test8003720.java \ -runtime/modules/LoadUnloadModuleStress.java \ -runtime/modules/ModuleStress/ExportModuleStressTest.java \ From 5058854b867323dd6537d7387bf20a9d5f258084 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Fri, 18 Aug 2023 06:45:18 +0000 Subject: [PATCH 105/162] 8314389: AttachListener::pd_set_flag obsolete Reviewed-by: cjplummer, mdoerr, sspitsyn --- src/hotspot/os/aix/attachListener_aix.cpp | 5 ----- src/hotspot/os/bsd/attachListener_bsd.cpp | 5 ----- src/hotspot/os/linux/attachListener_linux.cpp | 5 ----- src/hotspot/os/windows/attachListener_windows.cpp | 5 ----- src/hotspot/share/services/attachListener.cpp | 5 +---- src/hotspot/share/services/attachListener.hpp | 3 --- 6 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/hotspot/os/aix/attachListener_aix.cpp b/src/hotspot/os/aix/attachListener_aix.cpp index a02d337af46..7f5917f1357 100644 --- a/src/hotspot/os/aix/attachListener_aix.cpp +++ b/src/hotspot/os/aix/attachListener_aix.cpp @@ -579,11 +579,6 @@ void AttachListener::pd_data_dump() { os::signal_notify(SIGQUIT); } -jint AttachListener::pd_set_flag(AttachOperation* op, outputStream* out) { - out->print_cr("flag '%s' cannot be changed", op->arg(0)); - return JNI_ERR; -} - void AttachListener::pd_detachall() { // Cleanup server socket to detach clients. listener_cleanup(); diff --git a/src/hotspot/os/bsd/attachListener_bsd.cpp b/src/hotspot/os/bsd/attachListener_bsd.cpp index cf1ca453089..07a49bd497b 100644 --- a/src/hotspot/os/bsd/attachListener_bsd.cpp +++ b/src/hotspot/os/bsd/attachListener_bsd.cpp @@ -542,11 +542,6 @@ void AttachListener::pd_data_dump() { os::signal_notify(SIGQUIT); } -jint AttachListener::pd_set_flag(AttachOperation* op, outputStream* out) { - out->print_cr("flag '%s' cannot be changed", op->arg(0)); - return JNI_ERR; -} - void AttachListener::pd_detachall() { // do nothing for now } diff --git a/src/hotspot/os/linux/attachListener_linux.cpp b/src/hotspot/os/linux/attachListener_linux.cpp index 139fd58774a..359983ccb07 100644 --- a/src/hotspot/os/linux/attachListener_linux.cpp +++ b/src/hotspot/os/linux/attachListener_linux.cpp @@ -547,11 +547,6 @@ void AttachListener::pd_data_dump() { os::signal_notify(SIGQUIT); } -jint AttachListener::pd_set_flag(AttachOperation* op, outputStream* out) { - out->print_cr("flag '%s' cannot be changed", op->arg(0)); - return JNI_ERR; -} - void AttachListener::pd_detachall() { // do nothing for now } diff --git a/src/hotspot/os/windows/attachListener_windows.cpp b/src/hotspot/os/windows/attachListener_windows.cpp index d14ce2a848c..da3b6c56739 100644 --- a/src/hotspot/os/windows/attachListener_windows.cpp +++ b/src/hotspot/os/windows/attachListener_windows.cpp @@ -391,11 +391,6 @@ void AttachListener::pd_data_dump() { os::signal_notify(SIGBREAK); } -jint AttachListener::pd_set_flag(AttachOperation* op, outputStream* out) { - out->print_cr("flag '%s' cannot be changed", op->arg(0)); - return JNI_ERR; -} - void AttachListener::pd_detachall() { // do nothing for now } diff --git a/src/hotspot/share/services/attachListener.cpp b/src/hotspot/share/services/attachListener.cpp index ebbb2e10036..630ceb8e998 100644 --- a/src/hotspot/share/services/attachListener.cpp +++ b/src/hotspot/share/services/attachListener.cpp @@ -319,13 +319,10 @@ static jint set_flag(AttachOperation* op, outputStream* out) { int ret = WriteableFlags::set_flag(op->arg(0), op->arg(1), JVMFlagOrigin::ATTACH_ON_DEMAND, err_msg); if (ret != JVMFlag::SUCCESS) { if (ret == JVMFlag::NON_WRITABLE) { - // if the flag is not manageable try to change it through - // the platform dependent implementation - return AttachListener::pd_set_flag(op, out); + out->print_cr("flag '%s' cannot be changed", op->arg(0)); } else { out->print_cr("%s", err_msg.buffer()); } - return JNI_ERR; } return JNI_OK; diff --git a/src/hotspot/share/services/attachListener.hpp b/src/hotspot/share/services/attachListener.hpp index bef4087e2ea..c49f996cdb4 100644 --- a/src/hotspot/share/services/attachListener.hpp +++ b/src/hotspot/share/services/attachListener.hpp @@ -121,9 +121,6 @@ class AttachListener: AllStatic { // platform specific initialization static int pd_init(); - // platform specific flag change - static jint pd_set_flag(AttachOperation* op, outputStream* out); - // platform specific detachall static void pd_detachall(); From 33d5dfdab3098549366088c43797bdcaebe02cd6 Mon Sep 17 00:00:00 2001 From: Andrei Rybak Date: Fri, 18 Aug 2023 07:48:50 +0000 Subject: [PATCH 106/162] 8314543: gitattributes: make diffs easier to read Git supports special hunk headers for several languages in diff output, which make it easier to read diffs of files in that language, generated by Git (git-diff, git-show, `git log -p`, etc). For details, see `git help gitattributes` or the online documentation.[1] Add entries to the root .gitattributes file to support showing the hunk headers for Java, C, C++, Markdown, Shell script, HTML, and CSS. This makes it easier to read diffs generated by Git. [1] https://git-scm.com/docs/gitattributes Reviewed-by: erikj, ksakata --- .gitattributes | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitattributes b/.gitattributes index 77450626296..ebb586628c3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,10 @@ * -text +*.java diff=java +*.c diff=cpp +*.h diff=cpp +*.cpp diff=cpp +*.hpp diff=cpp +*.md diff=markdown +*.sh diff=bash +*.html diff=html +*.css diff=css From 2f04bc5f934887029d8bcc13cf722d8498a35120 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Fri, 18 Aug 2023 10:44:20 +0000 Subject: [PATCH 107/162] 8313697: [XWayland][Screencast] consequent getPixelColor calls are slow 8310334: [XWayland][Screencast] screen capture error message in debug Reviewed-by: serb, prr --- .../sun/awt/screencast/ScreencastHelper.java | 28 ++++ .../sun/awt/screencast/TokenStorage.java | 4 + .../native/libawt_xawt/awt/gtk3_interface.c | 2 + .../native/libawt_xawt/awt/gtk3_interface.h | 3 + .../native/libawt_xawt/awt/gtk_interface.h | 4 + .../libawt_xawt/awt/screencast_pipewire.c | 150 ++++++++++++------ .../libawt_xawt/awt/screencast_portal.c | 7 +- 7 files changed, 148 insertions(+), 50 deletions(-) diff --git a/src/java.desktop/unix/classes/sun/awt/screencast/ScreencastHelper.java b/src/java.desktop/unix/classes/sun/awt/screencast/ScreencastHelper.java index e61fd1a90e6..6a19b9fab87 100644 --- a/src/java.desktop/unix/classes/sun/awt/screencast/ScreencastHelper.java +++ b/src/java.desktop/unix/classes/sun/awt/screencast/ScreencastHelper.java @@ -35,6 +35,8 @@ import java.util.Arrays; import java.util.List; import java.util.Set; +import java.util.Timer; +import java.util.TimerTask; import java.util.stream.IntStream; /** @@ -54,6 +56,13 @@ public class ScreencastHelper { private static final int DENIED = -11; private static final int OUT_OF_BOUNDS = -12; + private static final int DELAY_BEFORE_SESSION_CLOSE = 2000; + + private static volatile TimerTask timerTask = null; + private static final Timer timerCloseSession + = new Timer("auto-close screencast session", true); + + private ScreencastHelper() { } @@ -105,11 +114,30 @@ private static List getSystemScreensBounds() { ).toList(); } + private static synchronized native void closeSession(); + + private static void timerCloseSessionRestart() { + if (timerTask != null) { + timerTask.cancel(); + } + + timerTask = new TimerTask() { + @Override + public void run() { + closeSession(); + } + }; + + timerCloseSession.schedule(timerTask, DELAY_BEFORE_SESSION_CLOSE); + } + public static synchronized void getRGBPixels( int x, int y, int width, int height, int[] pixelArray ) { if (!IS_NATIVE_LOADED) return; + timerCloseSessionRestart(); + Rectangle captureArea = new Rectangle(x, y, width, height); List affectedScreenBounds = getSystemScreensBounds() diff --git a/src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java b/src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java index 022ca5e7dbb..d39f7943c29 100644 --- a/src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java +++ b/src/java.desktop/unix/classes/sun/awt/screencast/TokenStorage.java @@ -324,6 +324,10 @@ static Set getTokens(List affectedScreenBounds) { return tokenItem; }) .filter(Objects::nonNull) + .sorted((t1, t2) -> //Token with more screens preferred + t2.allowedScreensBounds.size() + - t1.allowedScreensBounds.size() + ) .toList(); } diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c index 206a91132bc..4c690db2e67 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c +++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c @@ -604,6 +604,7 @@ GtkApi* gtk3_load(JNIEnv *env, const char* lib_name) fp_g_string_new = dl_symbol("g_string_new"); fp_g_string_erase = dl_symbol("g_string_erase"); + fp_g_string_set_size = dl_symbol("g_string_set_size"); fp_g_string_free = dl_symbol("g_string_free"); glib_version_2_68 = !fp_glib_check_version(2, 68, 0); @@ -3110,6 +3111,7 @@ static void gtk3_init(GtkApi* gtk) { gtk->g_string_new = fp_g_string_new; gtk->g_string_erase = fp_g_string_erase; + gtk->g_string_set_size = fp_g_string_set_size; gtk->g_string_free = fp_g_string_free; gtk->g_string_replace = fp_g_string_replace; gtk->g_string_printf = fp_g_string_printf; diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h index 0a3c8364e79..b858d5e6808 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h +++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h @@ -758,6 +758,9 @@ static GString *(*fp_g_string_erase)(GString *string, gssize pos, gssize len); +static GString *(*fp_g_string_set_size)(GString* string, + gsize len); + static gchar *(*fp_g_string_free)(GString *string, gboolean free_segment); diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.h b/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.h index 9c8c5743f7a..1ddc239d9b2 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.h +++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.h @@ -716,6 +716,10 @@ typedef struct GtkApi { gssize pos, gssize len); + GString *(*g_string_set_size)(GString* string, + gsize len); + + gchar *(*g_string_free)(GString *string, gboolean free_segment); diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.c b/src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.c index a5443784e00..132ccd0b7c4 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.c +++ b/src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.c @@ -43,6 +43,9 @@ int DEBUG_SCREENCAST_ENABLED = FALSE; (*env)->ExceptionDescribe(env); \ } +static volatile gboolean sessionClosed = TRUE; +static GString *activeSessionToken; + struct ScreenSpace screenSpace = {0}; static struct PwLoopData pw = {0}; @@ -89,8 +92,8 @@ static void doCleanup() { struct ScreenProps *screenProps = &screenSpace.screens[i]; if (screenProps->data) { if (screenProps->data->stream) { - fp_pw_thread_loop_lock(pw.loop); fp_pw_stream_disconnect(screenProps->data->stream); + fp_pw_thread_loop_lock(pw.loop); fp_pw_stream_destroy(screenProps->data->stream); fp_pw_thread_loop_unlock(pw.loop); screenProps->data->stream = NULL; @@ -123,7 +126,11 @@ static void doCleanup() { if (screenSpace.screens) { free(screenSpace.screens); screenSpace.screens = NULL; + screenSpace.screenCount = 0; } + + gtk->g_string_set_size(activeSessionToken, 0); + sessionClosed = TRUE; } /** @@ -132,6 +139,24 @@ static void doCleanup() { static gboolean initScreencast(const gchar *token, GdkRectangle *affectedBounds, gint affectedBoundsLength) { + gboolean isSameToken = !token + ? FALSE + : strcmp(token, activeSessionToken->str) == 0; + + if (!sessionClosed) { + if (isSameToken) { + DEBUG_SCREENCAST("Reusing active session.\n", NULL); + return TRUE; + } else { + DEBUG_SCREENCAST( + "Active session has a different token |%s| -> |%s|," + " closing current session.\n", + activeSessionToken->str, token + ); + doCleanup(); + } + } + fp_pw_init(NULL, NULL); pw.pwFd = RESULT_ERROR; @@ -145,6 +170,8 @@ static gboolean initScreencast(const gchar *token, return FALSE; } + gtk->g_string_printf(activeSessionToken, "%s", token); + sessionClosed = FALSE; return TRUE; } @@ -386,8 +413,19 @@ static gboolean connectStream(int index) { data->screenProps = &screenSpace.screens[index]; - data->hasFormat = FALSE; + if (!sessionClosed && data->stream) { + fp_pw_thread_loop_lock(pw.loop); + int result = fp_pw_stream_set_active(data->stream, TRUE); + fp_pw_thread_loop_unlock(pw.loop); + + DEBUG_SCREEN_PREFIX(data->screenProps, + "stream %p: activate result |%i|\n", + data->stream, result); + + return result == 0; // 0 - success + }; + data->hasFormat = FALSE; data->stream = fp_pw_stream_new( pw.core, @@ -505,60 +543,64 @@ static const struct pw_core_events coreEvents = { * @return TRUE on success */ static gboolean doLoop(GdkRectangle requestedArea) { - pw.loop = fp_pw_thread_loop_new("AWT Pipewire Thread", NULL); - - if (!pw.loop) { - DEBUG_SCREENCAST("!!! Could not create a loop\n", NULL); - doCleanup(); - return FALSE; - } - - pw.context = fp_pw_context_new( - fp_pw_thread_loop_get_loop(pw.loop), - NULL, - 0 - ); + if (!pw.loop && !sessionClosed) { + pw.loop = fp_pw_thread_loop_new("AWT Pipewire Thread", NULL); - if (!pw.context) { - DEBUG_SCREENCAST("!!! Could not create a pipewire context\n", NULL); - doCleanup(); - return FALSE; - } + if (!pw.loop) { + DEBUG_SCREENCAST("!!! Could not create a loop\n", NULL); + doCleanup(); + return FALSE; + } - if (fp_pw_thread_loop_start(pw.loop) != 0) { - DEBUG_SCREENCAST("!!! Could not start pipewire thread loop\n", NULL); - doCleanup(); - return FALSE; - } + pw.context = fp_pw_context_new( + fp_pw_thread_loop_get_loop(pw.loop), + NULL, + 0 + ); - fp_pw_thread_loop_lock(pw.loop); + if (!pw.context) { + DEBUG_SCREENCAST("!!! Could not create a pipewire context\n", NULL); + doCleanup(); + return FALSE; + } - pw.core = fp_pw_context_connect_fd( - pw.context, - pw.pwFd, - NULL, - 0 - ); + if (fp_pw_thread_loop_start(pw.loop) != 0) { + DEBUG_SCREENCAST("!!! Could not start pipewire thread loop\n", NULL); + doCleanup(); + return FALSE; + } - if (!pw.core) { - DEBUG_SCREENCAST("!!! Could not create pipewire core\n", NULL); - goto fail; - } + fp_pw_thread_loop_lock(pw.loop); - pw_core_add_listener(pw.core, &pw.coreListener, &coreEvents, NULL); + pw.core = fp_pw_context_connect_fd( + pw.context, + pw.pwFd, + NULL, + 0 + ); - for (int i = 0; i < screenSpace.screenCount; ++i) { - struct PwStreamData *data = - (struct PwStreamData*) malloc(sizeof (struct PwStreamData)); - if (!data) { - ERR("failed to allocate memory\n"); + if (!pw.core) { + DEBUG_SCREENCAST("!!! Could not create pipewire core\n", NULL); goto fail; } - memset(data, 0, sizeof (struct PwStreamData)); + pw_core_add_listener(pw.core, &pw.coreListener, &coreEvents, NULL); + } + for (int i = 0; i < screenSpace.screenCount; ++i) { struct ScreenProps *screen = &screenSpace.screens[i]; - screen->data = data; + if (!screen->data && !sessionClosed) { + struct PwStreamData *data = + (struct PwStreamData*) malloc(sizeof (struct PwStreamData)); + if (!data) { + ERR("failed to allocate memory\n"); + goto fail; + } + + memset(data, 0, sizeof (struct PwStreamData)); + + screen->data = data; + } DEBUG_SCREEN_PREFIX(screen, "@@@ adding screen %i\n", i); if (checkScreen(i, requestedArea)) { @@ -746,6 +788,8 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_screencast_ScreencastHelper_loadPipewire return JNI_FALSE; } + activeSessionToken = gtk->g_string_new(""); + gboolean usable = initXdgDesktopPortal(); portalScreenCastCleanup(); return usable; @@ -783,6 +827,17 @@ static void arrayToRectangles(JNIEnv *env, (*env)->ReleaseIntArrayElements(env, boundsArray, body, 0); } +/* + * Class: sun_awt_screencast_ScreencastHelper + * Method: closeSession + * Signature: ()V + */ +JNIEXPORT void JNICALL +Java_sun_awt_screencast_ScreencastHelper_closeSession(JNIEnv *env, jclass cls) { + DEBUG_SCREENCAST("closing screencast session\n\n", NULL); + doCleanup(); +} + /* * Class: sun_awt_screencast_ScreencastHelper * Method: getRGBPixelsImpl @@ -805,7 +860,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_getRGBPixelsImpl boundsLen = (*env)->GetArrayLength(env, affectedScreensBoundsArray); EXCEPTION_CHECK_DESCRIBE(); if (boundsLen % 4 != 0) { - DEBUG_SCREENCAST("%s:%i incorrect array length\n", __FUNCTION__, __LINE__); + DEBUG_SCREENCAST("incorrect array length\n", NULL); return RESULT_ERROR; } affectedBoundsLength = boundsLen / 4; @@ -896,11 +951,12 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_getRGBPixelsImpl fp_pw_thread_loop_lock(pw.loop); fp_pw_stream_set_active(screenProps->data->stream, FALSE); - fp_pw_stream_disconnect(screenProps->data->stream); fp_pw_thread_loop_unlock(pw.loop); + + screenProps->captureDataReady = FALSE; } } - doCleanup(); + releaseToken(env, jtoken, token); return 0; } diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/screencast_portal.c b/src/java.desktop/unix/native/libawt_xawt/awt/screencast_portal.c index e314359a325..8590cf27da2 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/screencast_portal.c +++ b/src/java.desktop/unix/native/libawt_xawt/awt/screencast_portal.c @@ -777,6 +777,10 @@ int portalScreenCastOpenPipewireRemote() { } void portalScreenCastCleanup() { + if (!portal) { + return; + } + if (portal->screenCastSessionHandle) { gtk->g_dbus_connection_call_sync( portal->connection, @@ -796,9 +800,6 @@ void portalScreenCastCleanup() { portal->screenCastSessionHandle = NULL; } - if (!portal) { - return; - } if (portal->connection) { gtk->g_object_unref(portal->connection); portal->connection = NULL; From 752121114f424d8e673ee8b7bb85f7705a82b9cc Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 18 Aug 2023 12:06:02 +0000 Subject: [PATCH 108/162] 8314265: Fix -Wconversion warnings in miscellaneous runtime code Reviewed-by: stuefe, dholmes, chagedorn --- src/hotspot/share/cds/archiveHeapWriter.cpp | 6 +++--- src/hotspot/share/cds/classListParser.cpp | 3 ++- src/hotspot/share/cds/filemap.cpp | 2 +- src/hotspot/share/cds/filemap.hpp | 4 ++-- .../share/classfile/systemDictionaryShared.hpp | 2 +- .../share/gc/shared/jvmFlagConstraintsGC.cpp | 14 +++++++------- .../share/gc/shared/jvmFlagConstraintsGC.hpp | 6 +++--- .../share/interpreter/interpreterRuntime.cpp | 2 +- .../share/interpreter/templateInterpreter.cpp | 2 +- src/hotspot/share/logging/logOutput.cpp | 6 +++--- src/hotspot/share/logging/logSelection.cpp | 2 +- src/hotspot/share/memory/metaspace.cpp | 18 +++++++++--------- .../share/memory/metaspace/metaspaceCommon.cpp | 6 +++--- src/hotspot/share/oops/instanceKlass.cpp | 1 - src/hotspot/share/oops/objArrayKlass.cpp | 2 +- src/hotspot/share/oops/typeArrayKlass.cpp | 2 +- src/hotspot/share/runtime/globals.hpp | 8 ++++---- .../share/services/diagnosticCommand.cpp | 7 ++++--- src/hotspot/share/services/heapDumper.cpp | 8 ++++---- src/hotspot/share/services/mallocSiteTable.cpp | 2 +- src/hotspot/share/services/memReporter.cpp | 4 ++-- src/hotspot/share/services/nmtPreInit.hpp | 2 +- src/hotspot/share/services/threadIdTable.cpp | 4 ++-- src/hotspot/share/services/threadService.hpp | 4 ++-- .../share/services/threadStackTracker.cpp | 2 +- src/hotspot/share/utilities/copy.cpp | 2 +- src/hotspot/share/utilities/elfFile.cpp | 17 +++++++++-------- src/hotspot/share/utilities/elfFile.hpp | 2 +- .../share/utilities/elfFuncDescTable.cpp | 2 +- .../share/utilities/elfFuncDescTable.hpp | 2 +- src/hotspot/share/utilities/elfSymbolTable.cpp | 4 ++-- .../share/utilities/population_count.hpp | 4 ++-- .../share/utilities/tableStatistics.cpp | 18 +++++++++--------- src/hotspot/share/utilities/xmlstream.cpp | 2 +- .../metaspace/test_chunkManager_stress.cpp | 4 ++-- 35 files changed, 89 insertions(+), 87 deletions(-) diff --git a/src/hotspot/share/cds/archiveHeapWriter.cpp b/src/hotspot/share/cds/archiveHeapWriter.cpp index c52814440af..032190c841d 100644 --- a/src/hotspot/share/cds/archiveHeapWriter.cpp +++ b/src/hotspot/share/cds/archiveHeapWriter.cpp @@ -456,12 +456,12 @@ void ArchiveHeapWriter::update_header_for_requested_obj(oop requested_obj, oop s // identity_hash for all shared objects, so they are less likely to be written // into during run time, increasing the potential of memory sharing. if (src_obj != nullptr) { - int src_hash = src_obj->identity_hash(); + intptr_t src_hash = src_obj->identity_hash(); fake_oop->set_mark(markWord::prototype().copy_set_hash(src_hash)); assert(fake_oop->mark().is_unlocked(), "sanity"); - DEBUG_ONLY(int archived_hash = fake_oop->identity_hash()); - assert(src_hash == archived_hash, "Different hash codes: original %x, archived %x", src_hash, archived_hash); + DEBUG_ONLY(intptr_t archived_hash = fake_oop->identity_hash()); + assert(src_hash == archived_hash, "Different hash codes: original " INTPTR_FORMAT ", archived " INTPTR_FORMAT, src_hash, archived_hash); } } diff --git a/src/hotspot/share/cds/classListParser.cpp b/src/hotspot/share/cds/classListParser.cpp index 9c269aecf32..e2099620a77 100644 --- a/src/hotspot/share/cds/classListParser.cpp +++ b/src/hotspot/share/cds/classListParser.cpp @@ -73,6 +73,7 @@ ClassListParser::ClassListParser(const char* file, ParseMode parse_mode) : _id2k vm_exit_during_initialization("Loading classlist failed", errmsg); } _line_no = 0; + _token = _line; _interfaces = new (mtClass) GrowableArray(10, mtClass); _indy_items = new (mtClass) GrowableArray(9, mtClass); _parse_mode = parse_mode; @@ -413,7 +414,7 @@ void ClassListParser::print_actual_interfaces(InstanceKlass* ik) { void ClassListParser::error(const char* msg, ...) { va_list ap; va_start(ap, msg); - int error_index = _token - _line; + int error_index = pointer_delta_as_int(_token, _line); if (error_index >= _line_len) { error_index = _line_len - 1; } diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index c40eea83c86..7a05c3069db 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -223,8 +223,8 @@ void FileMapHeader::populate(FileMapInfo *info, size_t core_region_alignment, _app_class_paths_start_index = ClassLoaderExt::app_class_paths_start_index(); _app_module_paths_start_index = ClassLoaderExt::app_module_paths_start_index(); - _num_module_paths = ClassLoader::num_module_path_entries(); _max_used_path_index = ClassLoaderExt::max_used_path_index(); + _num_module_paths = ClassLoader::num_module_path_entries(); _verify_local = BytecodeVerificationLocal; _verify_remote = BytecodeVerificationRemote; diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp index 2354df2f0b1..784a2cc6980 100644 --- a/src/hotspot/share/cds/filemap.hpp +++ b/src/hotspot/share/cds/filemap.hpp @@ -217,8 +217,8 @@ class FileMapHeader: private CDSFileMapHeaderBase { jshort _app_class_paths_start_index; // Index of first app classpath entry jshort _app_module_paths_start_index; // Index of first module path entry - jshort _num_module_paths; // number of module path entries jshort _max_used_path_index; // max path index referenced during CDS dump + int _num_module_paths; // number of module path entries bool _verify_local; // BytecodeVerificationLocal setting bool _verify_remote; // BytecodeVerificationRemote setting bool _has_platform_or_app_classes; // Archive contains app classes @@ -276,7 +276,7 @@ class FileMapHeader: private CDSFileMapHeaderBase { jshort max_used_path_index() const { return _max_used_path_index; } jshort app_module_paths_start_index() const { return _app_module_paths_start_index; } jshort app_class_paths_start_index() const { return _app_class_paths_start_index; } - jshort num_module_paths() const { return _num_module_paths; } + int num_module_paths() const { return _num_module_paths; } void set_has_platform_or_app_classes(bool v) { _has_platform_or_app_classes = v; } void set_cloned_vtables(char* p) { set_as_offset(p, &_cloned_vtables_offset); } diff --git a/src/hotspot/share/classfile/systemDictionaryShared.hpp b/src/hotspot/share/classfile/systemDictionaryShared.hpp index f43ab838ae6..da167a19c6e 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.hpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.hpp @@ -155,7 +155,7 @@ class SystemDictionaryShared: public SystemDictionary { }; public: - enum { + enum : char { FROM_FIELD_IS_PROTECTED = 1 << 0, FROM_IS_ARRAY = 1 << 1, FROM_IS_OBJECT = 1 << 2 diff --git a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp index 2e876f94e89..8ac9a3fc783 100644 --- a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp +++ b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -156,11 +156,11 @@ JVMFlag::Error MarkStackSizeConstraintFunc(size_t value, bool verbose) { } } -JVMFlag::Error MinMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose) { +JVMFlag::Error MinMetaspaceFreeRatioConstraintFunc(uint value, bool verbose) { if (value > MaxMetaspaceFreeRatio) { JVMFlag::printError(verbose, - "MinMetaspaceFreeRatio (" UINTX_FORMAT ") must be " - "less than or equal to MaxMetaspaceFreeRatio (" UINTX_FORMAT ")\n", + "MinMetaspaceFreeRatio (%u) must be " + "less than or equal to MaxMetaspaceFreeRatio (%u)\n", value, MaxMetaspaceFreeRatio); return JVMFlag::VIOLATES_CONSTRAINT; } else { @@ -168,11 +168,11 @@ JVMFlag::Error MinMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose) { } } -JVMFlag::Error MaxMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose) { +JVMFlag::Error MaxMetaspaceFreeRatioConstraintFunc(uint value, bool verbose) { if (value < MinMetaspaceFreeRatio) { JVMFlag::printError(verbose, - "MaxMetaspaceFreeRatio (" UINTX_FORMAT ") must be " - "greater than or equal to MinMetaspaceFreeRatio (" UINTX_FORMAT ")\n", + "MaxMetaspaceFreeRatio (%u) must be " + "greater than or equal to MinMetaspaceFreeRatio (%u)\n", value, MinMetaspaceFreeRatio); return JVMFlag::VIOLATES_CONSTRAINT; } else { diff --git a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp index 12a6abd1f57..591838c0717 100644 --- a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp +++ b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,8 +47,8 @@ f(uintx, MaxHeapFreeRatioConstraintFunc) \ f(intx, SoftRefLRUPolicyMSPerMBConstraintFunc) \ f(size_t, MarkStackSizeConstraintFunc) \ - f(uintx, MinMetaspaceFreeRatioConstraintFunc) \ - f(uintx, MaxMetaspaceFreeRatioConstraintFunc) \ + f(uint, MinMetaspaceFreeRatioConstraintFunc) \ + f(uint, MaxMetaspaceFreeRatioConstraintFunc) \ f(uintx, InitialTenuringThresholdConstraintFunc) \ f(uintx, MaxTenuringThresholdConstraintFunc) \ \ diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp index 9251e027994..110937fd15b 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp @@ -1333,7 +1333,7 @@ void SignatureHandlerLibrary::add(const methodHandle& method) { ResourceMark rm; ptrdiff_t align_offset = align_up(_buffer, CodeEntryAlignment) - (address)_buffer; CodeBuffer buffer((address)(_buffer + align_offset), - SignatureHandlerLibrary::buffer_size - align_offset); + checked_cast(SignatureHandlerLibrary::buffer_size - align_offset)); InterpreterRuntime::SignatureHandlerGenerator(method, &buffer).generate(fingerprint); // copy into code heap address handler = set_handler(&buffer); diff --git a/src/hotspot/share/interpreter/templateInterpreter.cpp b/src/hotspot/share/interpreter/templateInterpreter.cpp index 5982763e1a2..ca1395680e0 100644 --- a/src/hotspot/share/interpreter/templateInterpreter.cpp +++ b/src/hotspot/share/interpreter/templateInterpreter.cpp @@ -50,7 +50,7 @@ void TemplateInterpreter::initialize_stub() { // 270+ interpreter codelets are generated and each of them is aligned to HeapWordSize, // plus their code section is aligned to CodeEntryAlignement. So we need additional size due to alignment. int max_aligned_codelets = 280; - int max_aligned_bytes = max_aligned_codelets * (HeapWordSize + CodeEntryAlignment); + int max_aligned_bytes = checked_cast(max_aligned_codelets * (HeapWordSize + CodeEntryAlignment)); _code = new StubQueue(new InterpreterCodeletInterface, code_size + max_aligned_bytes, nullptr, "Interpreter"); } diff --git a/src/hotspot/share/logging/logOutput.cpp b/src/hotspot/share/logging/logOutput.cpp index 3ff6554380d..17d0e8b555d 100644 --- a/src/hotspot/share/logging/logOutput.cpp +++ b/src/hotspot/share/logging/logOutput.cpp @@ -65,8 +65,8 @@ void LogOutput::add_to_config_string(const LogSelection& selection) { } -static int tag_cmp(const void *a, const void *b) { - return static_cast(a) - static_cast(b); +static int tag_cmp(const LogTagType *a, const LogTagType *b) { + return primitive_compare(a, b); } static void sort_tags(LogTagType tags[LogTag::MaxTags]) { @@ -74,7 +74,7 @@ static void sort_tags(LogTagType tags[LogTag::MaxTags]) { while (tags[ntags] != LogTag::__NO_TAG) { ntags++; } - qsort(tags, ntags, sizeof(*tags), tag_cmp); + qsort(tags, ntags, sizeof(*tags), (_sort_Fn)tag_cmp); } static const size_t MaxSubsets = 1 << LogTag::MaxTags; diff --git a/src/hotspot/share/logging/logSelection.cpp b/src/hotspot/share/logging/logSelection.cpp index 26a13dded9a..16c6c6f63ca 100644 --- a/src/hotspot/share/logging/logSelection.cpp +++ b/src/hotspot/share/logging/logSelection.cpp @@ -226,7 +226,7 @@ double LogSelection::similarity(const LogSelection& other) const { } } } - return 2.0 * intersecting / (_ntags + other._ntags); + return 2.0 * (double)intersecting / (double)(_ntags + other._ntags); } // Comparator used for sorting LogSelections based on their similarity to a specific LogSelection. diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp index 718be07d372..a149deedd23 100644 --- a/src/hotspot/share/memory/metaspace.cpp +++ b/src/hotspot/share/memory/metaspace.cpp @@ -430,7 +430,7 @@ void MetaspaceGC::compute_new_size() { // Including the chunk free lists in the definition of "in use" is therefore // necessary. Not including the chunk free lists can cause capacity_until_GC to // shrink below committed_bytes() and this has caused serious bugs in the past. - const size_t used_after_gc = MetaspaceUtils::committed_bytes(); + const double used_after_gc = (double)MetaspaceUtils::committed_bytes(); const size_t capacity_until_GC = MetaspaceGC::capacity_until_GC(); const double minimum_free_percentage = MinMetaspaceFreeRatio / 100.0; @@ -464,10 +464,10 @@ void MetaspaceGC::compute_new_size() { new_capacity_until_GC, MetaspaceGCThresholdUpdater::ComputeNewSize); log_trace(gc, metaspace)(" expanding: minimum_desired_capacity: %6.1fKB expand_bytes: %6.1fKB MinMetaspaceExpansion: %6.1fKB new metaspace HWM: %6.1fKB", - minimum_desired_capacity / (double) K, - expand_bytes / (double) K, - MinMetaspaceExpansion / (double) K, - new_capacity_until_GC / (double) K); + (double) minimum_desired_capacity / (double) K, + (double) expand_bytes / (double) K, + (double) MinMetaspaceExpansion / (double) K, + (double) new_capacity_until_GC / (double) K); } return; } @@ -490,7 +490,7 @@ void MetaspaceGC::compute_new_size() { log_trace(gc, metaspace)(" maximum_free_percentage: %6.2f minimum_used_percentage: %6.2f", maximum_free_percentage, minimum_used_percentage); log_trace(gc, metaspace)(" minimum_desired_capacity: %6.1fKB maximum_desired_capacity: %6.1fKB", - minimum_desired_capacity / (double) K, maximum_desired_capacity / (double) K); + (double) minimum_desired_capacity / (double) K, (double) maximum_desired_capacity / (double) K); assert(minimum_desired_capacity <= maximum_desired_capacity, "sanity check"); @@ -517,9 +517,9 @@ void MetaspaceGC::compute_new_size() { _shrink_factor = MIN2(current_shrink_factor * 4, (uint) 100); } log_trace(gc, metaspace)(" shrinking: initThreshold: %.1fK maximum_desired_capacity: %.1fK", - MetaspaceSize / (double) K, maximum_desired_capacity / (double) K); + (double) MetaspaceSize / (double) K, (double) maximum_desired_capacity / (double) K); log_trace(gc, metaspace)(" shrink_bytes: %.1fK current_shrink_factor: %d new shrink factor: %d MinMetaspaceExpansion: %.1fK", - shrink_bytes / (double) K, current_shrink_factor, _shrink_factor, MinMetaspaceExpansion / (double) K); + (double) shrink_bytes / (double) K, current_shrink_factor, _shrink_factor, (double) MinMetaspaceExpansion / (double) K); } } @@ -708,7 +708,7 @@ void Metaspace::ergo_initialize() { // class space : non class space usage is about 1:6. With many small classes, // it can get as low as 1:2. It is not a big deal though since ccs is only // reserved and will be committed on demand only. - size_t max_ccs_size = MaxMetaspaceSize * 0.8; + size_t max_ccs_size = 8 * (MaxMetaspaceSize / 10); size_t adjusted_ccs_size = MIN2(CompressedClassSpaceSize, max_ccs_size); // CCS must be aligned to root chunk size, and be at least the size of one diff --git a/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp b/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp index 881a811fbed..aec656201fe 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp +++ b/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp @@ -103,7 +103,7 @@ void print_human_readable_size(outputStream* st, size_t byte_size, size_t scale, st->print(SIZE_FORMAT " words", byte_size / BytesPerWord); } else { const char* display_unit = display_unit_for_scale(scale); - float display_value = (float) byte_size / scale; + float display_value = (float) byte_size / (float)scale; // Prevent very small but non-null values showing up as 0.00. if (byte_size > 0 && display_value < 0.01f) { st->print("<0.01 %s", display_unit); @@ -118,7 +118,7 @@ void print_human_readable_size(outputStream* st, size_t byte_size, size_t scale, st->print("%*" PRIuPTR " words", width, byte_size / BytesPerWord); } else { const char* display_unit = display_unit_for_scale(scale); - float display_value = (float) byte_size / scale; + float display_value = (float) byte_size / (float)scale; // Since we use width to display a number with two trailing digits, increase it a bit. width += 3; // Prevent very small but non-null values showing up as 0.00. @@ -142,7 +142,7 @@ void print_percentage(outputStream* st, size_t total, size_t part) { st->print("100%%"); } else { // Note: clearly print very-small-but-not-0% and very-large-but-not-100% percentages. - float p = ((float)part / total) * 100.0f; + float p = ((float)part / (float)total) * 100.0f; if (p < 1.0f) { st->print(" <1%%"); } else if (p > 99.0f){ diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index a1c7eae402a..d157229d22d 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -1778,7 +1778,6 @@ void InstanceKlass::print_nonstatic_fields(FieldClosure* cl) { if (i > 0) { int length = i; assert(length == fields_sorted.length(), "duh"); - // _sort_Fn is defined in growableArray.hpp. fields_sorted.sort(compare_fields_by_offset); for (int i = 0; i < length; i++) { fd.reinitialize(this, fields_sorted.at(i).second); diff --git a/src/hotspot/share/oops/objArrayKlass.cpp b/src/hotspot/share/oops/objArrayKlass.cpp index 6cc6b5dce19..93695db4e3a 100644 --- a/src/hotspot/share/oops/objArrayKlass.cpp +++ b/src/hotspot/share/oops/objArrayKlass.cpp @@ -452,7 +452,7 @@ void ObjArrayKlass::oop_print_on(oop obj, outputStream* st) { ArrayKlass::oop_print_on(obj, st); assert(obj->is_objArray(), "must be objArray"); objArrayOop oa = objArrayOop(obj); - int print_len = MIN2((intx) oa->length(), MaxElementPrintSize); + int print_len = MIN2(oa->length(), MaxElementPrintSize); for(int index = 0; index < print_len; index++) { st->print(" - %3d : ", index); if (oa->obj_at(index) != nullptr) { diff --git a/src/hotspot/share/oops/typeArrayKlass.cpp b/src/hotspot/share/oops/typeArrayKlass.cpp index 6ce33fd41fb..842e37ef78e 100644 --- a/src/hotspot/share/oops/typeArrayKlass.cpp +++ b/src/hotspot/share/oops/typeArrayKlass.cpp @@ -343,7 +343,7 @@ void TypeArrayKlass::oop_print_on(oop obj, outputStream* st) { } void TypeArrayKlass::oop_print_elements_on(typeArrayOop ta, outputStream* st) { - int print_len = MIN2((intx) ta->length(), MaxElementPrintSize); + int print_len = MIN2(ta->length(), MaxElementPrintSize); switch (element_type()) { case T_BOOLEAN: print_boolean_array(ta, print_len, st); break; case T_CHAR: print_char_array(ta, print_len, st); break; diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index cf721f3de0c..b61ff2bdaaa 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -553,7 +553,7 @@ const int ObjectAlignmentInBytes = 8; "directory) of the dump file (defaults to java_pid.hprof " \ "in the working directory)") \ \ - product(intx, HeapDumpGzipLevel, 0, MANAGEABLE, \ + product(int, HeapDumpGzipLevel, 0, MANAGEABLE, \ "When HeapDumpOnOutOfMemoryError is on, the gzip compression " \ "level of the dump file. 0 (the default) disables gzip " \ "compression. Otherwise the level must be between 1 and 9.") \ @@ -1315,7 +1315,7 @@ const int ObjectAlignmentInBytes = 8; "max number of compiled code units to print in error log") \ range(0, VMError::max_error_log_print_code) \ \ - notproduct(intx, MaxElementPrintSize, 256, \ + notproduct(int, MaxElementPrintSize, 256, \ "maximum number of elements to print") \ \ notproduct(intx, MaxSubklassPrintSize, 4, \ @@ -1457,13 +1457,13 @@ const int ObjectAlignmentInBytes = 8; "The minimum expansion of Metaspace (in bytes)") \ range(0, max_uintx) \ \ - product(uintx, MaxMetaspaceFreeRatio, 70, \ + product(uint, MaxMetaspaceFreeRatio, 70, \ "The maximum percentage of Metaspace free after GC to avoid " \ "shrinking") \ range(0, 100) \ constraint(MaxMetaspaceFreeRatioConstraintFunc,AfterErgo) \ \ - product(uintx, MinMetaspaceFreeRatio, 40, \ + product(uint, MinMetaspaceFreeRatio, 40, \ "The minimum percentage of Metaspace free after GC to avoid " \ "expansion") \ range(0, 99) \ diff --git a/src/hotspot/share/services/diagnosticCommand.cpp b/src/hotspot/share/services/diagnosticCommand.cpp index 2ef389d6a95..8d346a5ea48 100644 --- a/src/hotspot/share/services/diagnosticCommand.cpp +++ b/src/hotspot/share/services/diagnosticCommand.cpp @@ -63,6 +63,7 @@ #include "utilities/events.hpp" #include "utilities/formatBuffer.hpp" #include "utilities/macros.hpp" +#include "utilities/parseInteger.hpp" #ifdef LINUX #include "trimCHeapDCmd.hpp" #include "mallocInfoDcmd.hpp" @@ -878,11 +879,11 @@ EventLogDCmd::EventLogDCmd(outputStream* output, bool heap) : void EventLogDCmd::execute(DCmdSource source, TRAPS) { const char* max_value = _max.value(); - long max = -1; + int max = -1; if (max_value != nullptr) { char* endptr = nullptr; - max = ::strtol(max_value, &endptr, 10); - if (max == 0 && max_value == endptr) { + int max; + if (!parse_integer(max_value, &max)) { output()->print_cr("Invalid max option: \"%s\".", max_value); return; } diff --git a/src/hotspot/share/services/heapDumper.cpp b/src/hotspot/share/services/heapDumper.cpp index 2a3650f850a..60f5981787b 100644 --- a/src/hotspot/share/services/heapDumper.cpp +++ b/src/hotspot/share/services/heapDumper.cpp @@ -967,7 +967,7 @@ u4 DumperSupport::get_static_fields_size(InstanceKlass* ik, u2& field_count) { } // We write the value itself plus a name and a one byte type tag per field. - return size + field_count * (sizeof(address) + 1); + return checked_cast(size + field_count * (sizeof(address) + 1)); } // dumps static fields of the given class @@ -1080,7 +1080,7 @@ void DumperSupport::dump_instance_class(AbstractDumpWriter* writer, Klass* k) { u4 static_size = get_static_fields_size(ik, static_fields_count); u2 instance_fields_count = get_instance_fields_count(ik); u4 instance_fields_size = instance_fields_count * (sizeof(address) + 1); - u4 size = 1 + sizeof(address) + 4 + 6 * sizeof(address) + 4 + 2 + 2 + static_size + 2 + instance_fields_size; + u4 size = checked_cast(1 + sizeof(address) + 4 + 6 * sizeof(address) + 4 + 2 + 2 + static_size + 2 + instance_fields_size); writer->start_sub_record(HPROF_GC_CLASS_DUMP, size); @@ -1190,7 +1190,7 @@ void DumperSupport::dump_object_array(AbstractDumpWriter* writer, objArrayOop ar // sizeof(u1) + 2 * sizeof(u4) + sizeof(objectID) + sizeof(classID) short header_size = 1 + 2 * 4 + 2 * sizeof(address); int length = calculate_array_max_length(writer, array, header_size); - u4 size = header_size + length * sizeof(address); + u4 size = checked_cast(header_size + length * sizeof(address)); writer->start_sub_record(HPROF_GC_OBJ_ARRAY_DUMP, size); writer->write_objectID(array); @@ -2153,7 +2153,7 @@ void VM_HeapDumper::dump_stack_traces() { depth += extra_frames; // write HPROF_TRACE record for one thread - DumperSupport::write_header(writer(), HPROF_TRACE, 3*sizeof(u4) + depth*oopSize); + DumperSupport::write_header(writer(), HPROF_TRACE, checked_cast(3*sizeof(u4) + depth*oopSize)); int stack_serial_num = _num_threads + STACK_TRACE_ID; writer()->write_u4(stack_serial_num); // stack trace serial number writer()->write_u4((u4) _num_threads); // thread serial number diff --git a/src/hotspot/share/services/mallocSiteTable.cpp b/src/hotspot/share/services/mallocSiteTable.cpp index 29eac09b77e..2780e86d892 100644 --- a/src/hotspot/share/services/mallocSiteTable.cpp +++ b/src/hotspot/share/services/mallocSiteTable.cpp @@ -229,7 +229,7 @@ void MallocSiteTable::print_tuning_statistics(outputStream* st) { st->print_cr("Malloc allocation site table:"); st->print_cr("\tTotal entries: %d", total_entries); st->print_cr("\tEmpty entries (no outstanding mallocs): %d (%2.2f%%)", - empty_entries, ((float)empty_entries * 100) / total_entries); + empty_entries, ((float)empty_entries * 100) / (float)total_entries); st->cr(); qsort(lengths, table_size, sizeof(uint16_t), qsort_helper); diff --git a/src/hotspot/share/services/memReporter.cpp b/src/hotspot/share/services/memReporter.cpp index 1a50b9ed26c..e1fb2b7a32f 100644 --- a/src/hotspot/share/services/memReporter.cpp +++ b/src/hotspot/share/services/memReporter.cpp @@ -282,7 +282,7 @@ void MemSummaryReporter::report_metadata(Metaspace::MetadataType type) const { const MetaspaceStats stats = MetaspaceUtils::get_statistics(type); size_t waste = stats.committed() - stats.used(); - float waste_percentage = stats.committed() > 0 ? (((float)waste * 100)/stats.committed()) : 0.0f; + float waste_percentage = stats.committed() > 0 ? (((float)waste * 100)/(float)stats.committed()) : 0.0f; out->print_cr("%27s ( %s)", " ", name); out->print("%27s ( ", " "); @@ -713,7 +713,7 @@ void MemSummaryDiffReporter::print_metaspace_diff(const char* header, // Diff waste const float waste_percentage = current_stats.committed() == 0 ? 0.0f : - (current_waste * 100.0f) / current_stats.committed(); + ((float)current_waste * 100.0f) / (float)current_stats.committed(); out->print("%27s ( waste=" SIZE_FORMAT "%s =%2.2f%%", " ", amount_in_current_scale(current_waste), scale, waste_percentage); if (diff_waste != 0) { diff --git a/src/hotspot/share/services/nmtPreInit.hpp b/src/hotspot/share/services/nmtPreInit.hpp index c6c504e99cd..1666863dfb1 100644 --- a/src/hotspot/share/services/nmtPreInit.hpp +++ b/src/hotspot/share/services/nmtPreInit.hpp @@ -162,7 +162,7 @@ class NMTPreInitAllocationTable { static index_t index_for_key(const void* p) { const uint64_t hash = calculate_hash(p); // "table_size" is a Mersenne prime, so "modulo" is all we need here. - return hash % table_size; + return checked_cast(hash % table_size); } const NMTPreInitAllocation* const * find_entry(const void* p) const { diff --git a/src/hotspot/share/services/threadIdTable.cpp b/src/hotspot/share/services/threadIdTable.cpp index 168b2e085ad..0a9c1233971 100644 --- a/src/hotspot/share/services/threadIdTable.cpp +++ b/src/hotspot/share/services/threadIdTable.cpp @@ -1,6 +1,6 @@ /* -* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -131,7 +131,7 @@ void ThreadIdTable::item_removed() { } double ThreadIdTable::get_load_factor() { - return ((double)_items_count) / _current_size; + return ((double)_items_count) / (double)_current_size; } size_t ThreadIdTable::table_size() { diff --git a/src/hotspot/share/services/threadService.hpp b/src/hotspot/share/services/threadService.hpp index ce0ab3c5027..484741ad935 100644 --- a/src/hotspot/share/services/threadService.hpp +++ b/src/hotspot/share/services/threadService.hpp @@ -103,8 +103,8 @@ class ThreadService : public AllStatic { static jlong get_total_thread_count() { return _total_threads_count->get_value(); } static jlong get_peak_thread_count() { return _peak_threads_count->get_value(); } - static jlong get_live_thread_count() { return _atomic_threads_count; } - static jlong get_daemon_thread_count() { return _atomic_daemon_threads_count; } + static int get_live_thread_count() { return _atomic_threads_count; } + static int get_daemon_thread_count() { return _atomic_daemon_threads_count; } static jlong exited_allocated_bytes() { return Atomic::load(&_exited_allocated_bytes); } static void incr_exited_allocated_bytes(jlong size) { diff --git a/src/hotspot/share/services/threadStackTracker.cpp b/src/hotspot/share/services/threadStackTracker.cpp index afed620bb88..14616e10469 100644 --- a/src/hotspot/share/services/threadStackTracker.cpp +++ b/src/hotspot/share/services/threadStackTracker.cpp @@ -43,7 +43,7 @@ bool ThreadStackTracker::initialize(NMT_TrackingLevel level) { } int ThreadStackTracker::compare_thread_stack_base(const SimpleThreadStackSite& s1, const SimpleThreadStackSite& s2) { - return s1.base() - s2.base(); + return primitive_compare(s1.base(), s2.base()); } void ThreadStackTracker::new_thread_stack(void* base, size_t size, const NativeCallStack& stack) { diff --git a/src/hotspot/share/utilities/copy.cpp b/src/hotspot/share/utilities/copy.cpp index ef9840af6d4..9ead75f2ceb 100644 --- a/src/hotspot/share/utilities/copy.cpp +++ b/src/hotspot/share/utilities/copy.cpp @@ -236,7 +236,7 @@ void Copy::fill_to_memory_atomic(void* to, size_t size, jubyte value) { } } else if (bits % sizeof(jshort) == 0) { jshort fill = (jushort)( (jubyte)value ); // zero-extend - fill += fill << 8; + fill += (jshort)(fill << 8); //Copy::fill_to_jshorts_atomic((jshort*) dst, size / sizeof(jshort)); for (uintptr_t off = 0; off < size; off += sizeof(jshort)) { *(jshort*)(dst + off) = fill; diff --git a/src/hotspot/share/utilities/elfFile.cpp b/src/hotspot/share/utilities/elfFile.cpp index 2e26feec9a6..a0e7cd9f937 100644 --- a/src/hotspot/share/utilities/elfFile.cpp +++ b/src/hotspot/share/utilities/elfFile.cpp @@ -789,7 +789,7 @@ bool DwarfFile::DebugAranges::read_set_header(DebugArangesSetHeader& header) { // We must align to twice the address size. uint8_t alignment = DwarfFile::ADDRESS_SIZE * 2; - uint8_t padding = alignment - (_reader.get_position() - _section_start_address) % alignment; + long padding = alignment - (_reader.get_position() - _section_start_address) % alignment; return _reader.move_position(padding); } @@ -1423,7 +1423,7 @@ bool DwarfFile::LineNumberProgram::apply_extended_opcode() { // Must be an unsigned integer as specified in section 6.2.2 of the DWARF 4 spec for the discriminator register. return false; } - _state->_discriminator = discriminator; + _state->_discriminator = static_cast(discriminator); break; default: assert(false, "Unknown extended opcode"); @@ -1446,11 +1446,12 @@ bool DwarfFile::LineNumberProgram::apply_standard_opcode(const uint8_t opcode) { } break; case DW_LNS_advance_pc: { // 1 operand - uint64_t operation_advance; - if (!_reader.read_uleb128(&operation_advance, 4)) { + uint64_t adv; + if (!_reader.read_uleb128(&adv, 4)) { // Must be at most 4 bytes because the index register is only 4 bytes wide. return false; } + uint32_t operation_advance = checked_cast(adv); _state->add_to_address_register(operation_advance, _header); if (_state->_dwarf_version == 4) { _state->set_index_register(operation_advance, _header); @@ -1464,7 +1465,7 @@ bool DwarfFile::LineNumberProgram::apply_standard_opcode(const uint8_t opcode) { // line register is 4 bytes wide. return false; } - _state->_line += line; + _state->_line += static_cast(line); DWARF_LOG_TRACE(" DW_LNS_advance_line (%d)", _state->_line); break; case DW_LNS_set_file: // 1 operand @@ -1473,7 +1474,7 @@ bool DwarfFile::LineNumberProgram::apply_standard_opcode(const uint8_t opcode) { // file register is 4 bytes wide. return false; } - _state->_file = file; + _state->_file = static_cast(file); DWARF_LOG_TRACE(" DW_LNS_set_file (%u)", _state->_file); break; case DW_LNS_set_column: // 1 operand @@ -1482,7 +1483,7 @@ bool DwarfFile::LineNumberProgram::apply_standard_opcode(const uint8_t opcode) { // column register is 4 bytes wide. return false; } - _state->_column = column; + _state->_column = static_cast(column); DWARF_LOG_TRACE(" DW_LNS_set_column (%u)", _state->_column); break; case DW_LNS_negate_stmt: // No operands @@ -1528,7 +1529,7 @@ bool DwarfFile::LineNumberProgram::apply_standard_opcode(const uint8_t opcode) { // isa register is 4 bytes wide. return false; } - _state->_isa = isa; + _state->_isa = static_cast(isa); // only save 4 bytes DWARF_LOG_TRACE(" DW_LNS_set_isa (%u)", _state->_isa); break; default: diff --git a/src/hotspot/share/utilities/elfFile.hpp b/src/hotspot/share/utilities/elfFile.hpp index 1b572fca400..032c9c63ad4 100644 --- a/src/hotspot/share/utilities/elfFile.hpp +++ b/src/hotspot/share/utilities/elfFile.hpp @@ -483,7 +483,7 @@ class DwarfFile : public ElfFile { DwarfFile* _dwarf_file; MarkedDwarfFileReader _reader; - uint32_t _section_start_address; + uintptr_t _section_start_address; // a calculated end position long _entry_end; diff --git a/src/hotspot/share/utilities/elfFuncDescTable.cpp b/src/hotspot/share/utilities/elfFuncDescTable.cpp index 28ffd754b14..bd9beb202c6 100644 --- a/src/hotspot/share/utilities/elfFuncDescTable.cpp +++ b/src/hotspot/share/utilities/elfFuncDescTable.cpp @@ -46,7 +46,7 @@ ElfFuncDescTable::ElfFuncDescTable(FILE* file, Elf_Shdr shdr, int index) : ElfFuncDescTable::~ElfFuncDescTable() { } -address ElfFuncDescTable::lookup(Elf_Word index) { +address ElfFuncDescTable::lookup(Elf_Addr index) { if (NullDecoder::is_error(_status)) { return nullptr; } diff --git a/src/hotspot/share/utilities/elfFuncDescTable.hpp b/src/hotspot/share/utilities/elfFuncDescTable.hpp index dbfd2a9ee4e..a0e67611554 100644 --- a/src/hotspot/share/utilities/elfFuncDescTable.hpp +++ b/src/hotspot/share/utilities/elfFuncDescTable.hpp @@ -133,7 +133,7 @@ class ElfFuncDescTable: public CHeapObj { ~ElfFuncDescTable(); // return the function address for the function descriptor at 'index' or null on error - address lookup(Elf_Word index); + address lookup(Elf_Addr index); int get_index() const { return _index; }; diff --git a/src/hotspot/share/utilities/elfSymbolTable.cpp b/src/hotspot/share/utilities/elfSymbolTable.cpp index 868457418eb..520222cb0fe 100644 --- a/src/hotspot/share/utilities/elfSymbolTable.cpp +++ b/src/hotspot/share/utilities/elfSymbolTable.cpp @@ -48,7 +48,7 @@ ElfSymbolTable::~ElfSymbolTable() { bool ElfSymbolTable::compare(const Elf_Sym* sym, address addr, int* stringtableIndex, int* posIndex, int* offset, ElfFuncDescTable* funcDescTable) { if (STT_FUNC == ELF_ST_TYPE(sym->st_info)) { - Elf_Word st_size = sym->st_size; + Elf64_Xword st_size = sym->st_size; const Elf_Shdr* shdr = _section.section_header(); address sym_addr; if (funcDescTable != nullptr && funcDescTable->get_index() == sym->st_shndx) { @@ -77,7 +77,7 @@ bool ElfSymbolTable::lookup(address addr, int* stringtableIndex, int* posIndex, } size_t sym_size = sizeof(Elf_Sym); - int count = _section.section_header()->sh_size / sym_size; + int count = checked_cast(_section.section_header()->sh_size / sym_size); Elf_Sym* symbols = (Elf_Sym*)_section.section_data(); if (symbols != nullptr) { diff --git a/src/hotspot/share/utilities/population_count.hpp b/src/hotspot/share/utilities/population_count.hpp index df4dc335215..d5eaa11d5e5 100644 --- a/src/hotspot/share/utilities/population_count.hpp +++ b/src/hotspot/share/utilities/population_count.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ inline unsigned population_count(T x) { // The preceding multiply by z_ones is the only place where the intermediate // calculations can exceed the range of T. We need to discard any such excess // before the right-shift, hence the conversion back to T. - return static_cast(r) >> (((sizeof(T) - 1) * BitsPerByte)); + return checked_cast(static_cast(r) >> (((sizeof(T) - 1) * BitsPerByte))); } #endif // SHARE_UTILITIES_POPULATION_COUNT_HPP diff --git a/src/hotspot/share/utilities/tableStatistics.cpp b/src/hotspot/share/utilities/tableStatistics.cpp index 32692d2b45a..9d207dc74ac 100644 --- a/src/hotspot/share/utilities/tableStatistics.cpp +++ b/src/hotspot/share/utilities/tableStatistics.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,11 +74,11 @@ void TableRateStatistics::stamp() { } float TableRateStatistics::get_add_rate() { - return (float)((_added_items_stamp - _added_items_stamp_prev) / _seconds_stamp); + return (float)(((double)_added_items_stamp - (double)_added_items_stamp_prev) / _seconds_stamp); } float TableRateStatistics::get_remove_rate() { - return (float)((_removed_items_stamp - _removed_items_stamp_prev) / _seconds_stamp); + return (float)(_removed_items_stamp - _removed_items_stamp_prev) / (float)_seconds_stamp; } TableStatistics::TableStatistics() : @@ -101,12 +101,12 @@ TableStatistics::TableStatistics(NumberSeq summary, size_t literal_bytes, size_t _add_rate(0), _remove_rate(0) { _number_of_buckets = summary.num(); - _number_of_entries = summary.sum(); + _number_of_entries = (size_t)summary.sum(); - _maximum_bucket_size = summary.maximum(); - _average_bucket_size = summary.avg(); - _variance_of_bucket_size = summary.variance(); - _stddev_of_bucket_size = summary.sd(); + _maximum_bucket_size = (size_t)summary.maximum(); + _average_bucket_size = (float)summary.avg(); + _variance_of_bucket_size = (float)summary.variance(); + _stddev_of_bucket_size = (float)summary.sd(); _bucket_bytes = _number_of_buckets * bucket_bytes; _entry_bytes = _number_of_entries * node_bytes; @@ -140,7 +140,7 @@ void TableStatistics::print(outputStream* st, const char *table_name) { " bytes, each " SIZE_FORMAT, _number_of_entries, _entry_bytes, _entry_size); if (_literal_bytes != 0) { - float literal_avg = (_number_of_entries <= 0) ? 0 : (_literal_bytes / _number_of_entries); + float literal_avg = (_number_of_entries <= 0) ? 0.0f : (float)(_literal_bytes / _number_of_entries); st->print_cr("Number of literals : %9" PRIuPTR " = %9" PRIuPTR " bytes, avg %7.3f", _number_of_entries, _literal_bytes, literal_avg); diff --git a/src/hotspot/share/utilities/xmlstream.cpp b/src/hotspot/share/utilities/xmlstream.cpp index 081b53f9fa1..82cd6beb43a 100644 --- a/src/hotspot/share/utilities/xmlstream.cpp +++ b/src/hotspot/share/utilities/xmlstream.cpp @@ -160,7 +160,7 @@ void xmlStream::see_tag(const char* tag, bool push) { char* old_low = _element_close_stack_low; char* push_ptr = old_ptr - (tag_len+1); if (push_ptr < old_low) { - int old_len = _element_close_stack_high - old_ptr; + int old_len = pointer_delta_as_int(_element_close_stack_high, old_ptr); int new_len = old_len * 2; if (new_len < 100) new_len = 100; char* new_low = NEW_C_HEAP_ARRAY(char, new_len, mtInternal); diff --git a/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp b/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp index ddafce06242..ebeb1a8f643 100644 --- a/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp +++ b/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp @@ -54,7 +54,7 @@ class ChunkManagerRandomChunkAllocTest { // Assuming we allocate only the largest type of chunk, committed to the fullest commit factor, // how many chunks can we accomodate before hitting max_footprint_words? const size_t largest_chunk_size = word_size_for_level(r.lowest()); - int max_chunks = (max_footprint_words * commit_factor) / largest_chunk_size; + int max_chunks = (int)((max_footprint_words * commit_factor) / (float) largest_chunk_size); // .. but cap at (min) 50 and (max) 1000 max_chunks = MIN2(1000, max_chunks); max_chunks = MAX2(50, max_chunks); @@ -96,7 +96,7 @@ class ChunkManagerRandomChunkAllocTest { // Given a chunk level and a factor, return a random commit size. static size_t random_committed_words(chunklevel_t lvl, float commit_factor) { - const size_t sz = word_size_for_level(lvl) * commit_factor; + const size_t sz = (size_t)((float)word_size_for_level(lvl) * commit_factor); if (sz < 2) { return 0; } From fdac6a6ac871366614efe44aca58ab520766b5c8 Mon Sep 17 00:00:00 2001 From: Tyler Steele Date: Fri, 18 Aug 2023 13:58:58 +0000 Subject: [PATCH 109/162] 8312180: (bf) MappedMemoryUtils passes incorrect arguments to msync (aix) Reviewed-by: clanger, stuefe --- src/hotspot/share/classfile/javaClasses.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index c36c66a909c..95210a57b4d 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.cpp @@ -86,6 +86,7 @@ #include "runtime/vframe.inline.hpp" #include "runtime/vm_version.hpp" #include "utilities/align.hpp" +#include "utilities/globalDefinitions.hpp" #include "utilities/growableArray.hpp" #include "utilities/preserveException.hpp" #include "utilities/utf8.hpp" @@ -4711,7 +4712,7 @@ class UnsafeConstantsFixup : public FieldClosure { UnsafeConstantsFixup() { // round up values for all static final fields _address_size = sizeof(void*); - _page_size = (int)os::vm_page_size(); + _page_size = AIX_ONLY(sysconf(_SC_PAGESIZE)) NOT_AIX((int)os::vm_page_size()); _big_endian = LITTLE_ENDIAN_ONLY(false) BIG_ENDIAN_ONLY(true); _use_unaligned_access = UseUnalignedAccesses; _data_cache_line_flush_size = (int)VM_Version::data_cache_line_flush_size(); From c36e009772823c58a62fd2d45bbcc1390c4975ad Mon Sep 17 00:00:00 2001 From: Fredrik Bredberg Date: Fri, 18 Aug 2023 14:29:28 +0000 Subject: [PATCH 110/162] 8308984: Relativize last_sp (and top_frame_sp) in interpreter frames Reviewed-by: pchilanomate, aph, haosun --- .../continuationFreezeThaw_aarch64.inline.hpp | 12 +++++++----- .../aarch64/continuationHelper_aarch64.inline.hpp | 3 ++- src/hotspot/cpu/aarch64/frame_aarch64.cpp | 4 +++- src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp | 4 +++- src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp | 4 +++- .../templateInterpreterGenerator_aarch64.cpp | 9 ++++++--- .../cpu/ppc/continuationFreezeThaw_ppc.inline.hpp | 4 ++-- .../cpu/ppc/continuationHelper_ppc.inline.hpp | 2 +- src/hotspot/cpu/ppc/frame_ppc.inline.hpp | 8 +++++++- src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp | 11 ++++++++++- .../cpu/ppc/templateInterpreterGenerator_ppc.cpp | 4 +++- .../riscv/continuationFreezeThaw_riscv.inline.hpp | 12 +++++++----- .../cpu/riscv/continuationHelper_riscv.inline.hpp | 3 ++- src/hotspot/cpu/riscv/frame_riscv.cpp | 4 +++- src/hotspot/cpu/riscv/frame_riscv.inline.hpp | 4 +++- src/hotspot/cpu/riscv/interp_masm_riscv.cpp | 4 +++- .../riscv/templateInterpreterGenerator_riscv.cpp | 9 ++++++--- .../cpu/x86/continuationFreezeThaw_x86.inline.hpp | 14 ++++++++------ .../cpu/x86/continuationHelper_x86.inline.hpp | 3 ++- src/hotspot/cpu/x86/frame_x86.cpp | 4 +++- src/hotspot/cpu/x86/frame_x86.inline.hpp | 4 +++- src/hotspot/cpu/x86/interp_masm_x86.cpp | 5 ++++- .../cpu/x86/templateInterpreterGenerator_x86.cpp | 8 ++++++-- src/hotspot/share/runtime/frame.cpp | 7 +++---- src/hotspot/share/runtime/frame.hpp | 9 +++++++-- 25 files changed, 107 insertions(+), 48 deletions(-) diff --git a/src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp index 4e4aa95e171..23a5ad71025 100644 --- a/src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp +++ b/src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp @@ -83,7 +83,7 @@ frame FreezeBase::new_heap_frame(frame& f, frame& caller) { intptr_t *sp, *fp; // sp is really our unextended_sp if (FKind::interpreted) { assert((intptr_t*)f.at(frame::interpreter_frame_last_sp_offset) == nullptr - || f.unextended_sp() == (intptr_t*)f.at(frame::interpreter_frame_last_sp_offset), ""); + || f.unextended_sp() == (intptr_t*)f.at_relative(frame::interpreter_frame_last_sp_offset), ""); intptr_t locals_offset = *f.addr_at(frame::interpreter_frame_locals_offset); // If the caller.is_empty(), i.e. we're freezing into an empty chunk, then we set // the chunk's argsize in finalize_freeze and make room for it above the unextended_sp @@ -123,7 +123,7 @@ frame FreezeBase::new_heap_frame(frame& f, frame& caller) { void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) { assert((f.at(frame::interpreter_frame_last_sp_offset) != 0) || (f.unextended_sp() == f.sp()), ""); - intptr_t* real_unextended_sp = (intptr_t*)f.at(frame::interpreter_frame_last_sp_offset); + intptr_t* real_unextended_sp = (intptr_t*)f.at_relative_or_null(frame::interpreter_frame_last_sp_offset); if (real_unextended_sp != nullptr) { f.set_unextended_sp(real_unextended_sp); // can be null at a safepoint } @@ -149,8 +149,8 @@ inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, co // because we freeze the padding word (see recurse_freeze_interpreted_frame) in order to keep the same relativized // locals value, we don't need to change the locals value here. - // at(frame::interpreter_frame_last_sp_offset) can be null at safepoint preempts - *hf.addr_at(frame::interpreter_frame_last_sp_offset) = hf.unextended_sp() - hf.fp(); + // Make sure that last_sp is already relativized. + assert((intptr_t*)hf.at_relative(frame::interpreter_frame_last_sp_offset) == hf.unextended_sp(), ""); relativize_one(vfp, hfp, frame::interpreter_frame_initial_sp_offset); // == block_top == block_bottom relativize_one(vfp, hfp, frame::interpreter_frame_extended_sp_offset); @@ -290,7 +290,9 @@ static inline void derelativize_one(intptr_t* const fp, int offset) { inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, const frame& f) { intptr_t* vfp = f.fp(); - derelativize_one(vfp, frame::interpreter_frame_last_sp_offset); + // Make sure that last_sp is kept relativized. + assert((intptr_t*)f.at_relative(frame::interpreter_frame_last_sp_offset) == f.unextended_sp(), ""); + derelativize_one(vfp, frame::interpreter_frame_initial_sp_offset); derelativize_one(vfp, frame::interpreter_frame_extended_sp_offset); } diff --git a/src/hotspot/cpu/aarch64/continuationHelper_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/continuationHelper_aarch64.inline.hpp index 7d673eb8d0d..38005383248 100644 --- a/src/hotspot/cpu/aarch64/continuationHelper_aarch64.inline.hpp +++ b/src/hotspot/cpu/aarch64/continuationHelper_aarch64.inline.hpp @@ -125,7 +125,8 @@ inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, assert(res == (intptr_t*)f.interpreter_frame_monitor_end() - expression_stack_sz, ""); assert(res >= f.unextended_sp(), "res: " INTPTR_FORMAT " initial_sp: " INTPTR_FORMAT " last_sp: " INTPTR_FORMAT " unextended_sp: " INTPTR_FORMAT " expression_stack_size: %d", - p2i(res), p2i(f.addr_at(frame::interpreter_frame_initial_sp_offset)), f.at(frame::interpreter_frame_last_sp_offset), p2i(f.unextended_sp()), expression_stack_sz); + p2i(res), p2i(f.addr_at(frame::interpreter_frame_initial_sp_offset)), f.at_relative_or_null(frame::interpreter_frame_last_sp_offset), + p2i(f.unextended_sp()), expression_stack_sz); return res; } diff --git a/src/hotspot/cpu/aarch64/frame_aarch64.cpp b/src/hotspot/cpu/aarch64/frame_aarch64.cpp index 2357721ed3d..4ceae831e66 100644 --- a/src/hotspot/cpu/aarch64/frame_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/frame_aarch64.cpp @@ -355,7 +355,9 @@ void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) { // Used by template based interpreter deoptimization void frame::interpreter_frame_set_last_sp(intptr_t* sp) { - *((intptr_t**)addr_at(interpreter_frame_last_sp_offset)) = sp; + assert(is_interpreted_frame(), "interpreted frame expected"); + // set relativized last_sp + ptr_at_put(interpreter_frame_last_sp_offset, sp != nullptr ? (sp - fp()) : 0); } // Used by template based interpreter deoptimization diff --git a/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp index 5fc5fe9248e..c0ae3cdf2ac 100644 --- a/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp +++ b/src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp @@ -262,7 +262,9 @@ inline intptr_t* frame::interpreter_frame_locals() const { } inline intptr_t* frame::interpreter_frame_last_sp() const { - return (intptr_t*)at(interpreter_frame_last_sp_offset); + intptr_t n = *addr_at(interpreter_frame_last_sp_offset); + assert(n <= 0, "n: " INTPTR_FORMAT, n); + return n != 0 ? &fp()[n] : nullptr; } inline intptr_t* frame::interpreter_frame_bcp_addr() const { diff --git a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp index a86cc40ab50..823e481178e 100644 --- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp @@ -430,7 +430,9 @@ void InterpreterMacroAssembler::prepare_to_jump_from_interpreted() { // set sender sp mov(r19_sender_sp, sp); // record last_sp - str(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); + sub(rscratch1, esp, rfp); + asr(rscratch1, rscratch1, Interpreter::logStackElementSize); + str(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); } // Jump to from_interpreted entry of a call unless single stepping is possible diff --git a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp index 0f03c5f9b6f..ee69114ea26 100644 --- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp @@ -465,7 +465,8 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, address entry = __ pc(); // Restore stack bottom in case i2c adjusted stack - __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ ldr(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ lea(esp, Address(rfp, rscratch1, Address::lsl(Interpreter::logStackElementSize))); // and null it as marker that esp is now tos until next java call __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); __ restore_bcp(); @@ -521,7 +522,8 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, __ restore_sp_after_call(); // Restore SP to extended SP // Restore expression stack pointer - __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ ldr(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ lea(esp, Address(rfp, rscratch1, Address::lsl(Interpreter::logStackElementSize))); // null last_sp until next java call __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); @@ -1867,7 +1869,8 @@ void TemplateInterpreterGenerator::generate_throw_exception() { /* notify_jvmdi */ false); // Restore the last_sp and null it out - __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ ldr(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ lea(esp, Address(rfp, rscratch1, Address::lsl(Interpreter::logStackElementSize))); __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize)); __ restore_bcp(); diff --git a/src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp b/src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp index c72a4c8a54d..888b0870fe6 100644 --- a/src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp +++ b/src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp @@ -89,7 +89,7 @@ inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, co relativize_one(vfp, hfp, ijava_idx(monitors)); relativize_one(vfp, hfp, ijava_idx(esp)); - relativize_one(vfp, hfp, ijava_idx(top_frame_sp)); + // top_frame_sp is already relativized // hfp == hf.sp() + (f.fp() - f.sp()) is not true on ppc because the stack frame has room for // the maximal expression stack and the expression stack in the heap frame is trimmed. @@ -544,7 +544,7 @@ inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, c derelativize_one(vfp, ijava_idx(monitors)); derelativize_one(vfp, ijava_idx(esp)); - derelativize_one(vfp, ijava_idx(top_frame_sp)); + // Keep top_frame_sp relativized. } inline void ThawBase::patch_pd(frame& f, const frame& caller) { diff --git a/src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp b/src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp index 3f4ddd64723..528f1f8ad96 100644 --- a/src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp +++ b/src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp @@ -86,7 +86,7 @@ inline void ContinuationHelper::InterpretedFrame::patch_sender_sp(frame& f, cons intptr_t* sp = caller.unextended_sp(); if (!f.is_heap_frame() && caller.is_interpreted_frame()) { // See diagram "Interpreter Calling Procedure on PPC" at the end of continuationFreezeThaw_ppc.inline.hpp - sp = (intptr_t*)caller.at(ijava_idx(top_frame_sp)); + sp = (intptr_t*)caller.at_relative(ijava_idx(top_frame_sp)); } assert(f.is_interpreted_frame(), ""); assert(f.is_heap_frame() || is_aligned(sp, frame::alignment_in_bytes), ""); diff --git a/src/hotspot/cpu/ppc/frame_ppc.inline.hpp b/src/hotspot/cpu/ppc/frame_ppc.inline.hpp index c59aed8d77b..bad713fac84 100644 --- a/src/hotspot/cpu/ppc/frame_ppc.inline.hpp +++ b/src/hotspot/cpu/ppc/frame_ppc.inline.hpp @@ -231,7 +231,13 @@ inline intptr_t* frame::interpreter_frame_esp() const { inline void frame::interpreter_frame_set_monitor_end(BasicObjectLock* end) { get_ijava_state()->monitors = (intptr_t) end;} inline void frame::interpreter_frame_set_cpcache(ConstantPoolCache* cp) { *interpreter_frame_cache_addr() = cp; } inline void frame::interpreter_frame_set_esp(intptr_t* esp) { get_ijava_state()->esp = (intptr_t) esp; } -inline void frame::interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp) { get_ijava_state()->top_frame_sp = (intptr_t) top_frame_sp; } + +inline void frame::interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp) { + assert(is_interpreted_frame(), "interpreted frame expected"); + // set relativized top_frame_sp + get_ijava_state()->top_frame_sp = (intptr_t) (top_frame_sp - fp()); +} + inline void frame::interpreter_frame_set_sender_sp(intptr_t* sender_sp) { get_ijava_state()->sender_sp = (intptr_t) sender_sp; } inline intptr_t* frame::interpreter_frame_expression_stack() const { diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp index 2873fc2eca0..4dd289c74be 100644 --- a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp @@ -1241,6 +1241,9 @@ void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, R save_interpreter_state(Rscratch2); #ifdef ASSERT ld(Rscratch1, _ijava_state_neg(top_frame_sp), Rscratch2); // Rscratch2 contains fp + sldi(Rscratch1, Rscratch1, Interpreter::logStackElementSize); + add(Rscratch1, Rscratch1, Rscratch2); // Rscratch2 contains fp + // Compare sender_sp with the derelativized top_frame_sp cmpd(CCR0, R21_sender_SP, Rscratch1); asm_assert_eq("top_frame_sp incorrect"); #endif @@ -2015,7 +2018,10 @@ void InterpreterMacroAssembler::add_monitor_to_stack(bool stack_is_empty, Regist "size of a monitor must respect alignment of SP"); resize_frame(-monitor_size, /*temp*/esp); // Allocate space for new monitor - std(R1_SP, _ijava_state_neg(top_frame_sp), esp); // esp contains fp + subf(Rtemp2, esp, R1_SP); // esp contains fp + sradi(Rtemp2, Rtemp2, Interpreter::logStackElementSize); + // Store relativized top_frame_sp + std(Rtemp2, _ijava_state_neg(top_frame_sp), esp); // esp contains fp // Shuffle expression stack down. Recall that stack_base points // just above the new expression stack bottom. Old_tos and new_tos @@ -2251,6 +2257,9 @@ void InterpreterMacroAssembler::restore_interpreter_state(Register scratch, bool Register tfsp = R18_locals; Register scratch2 = R26_monitor; ld(tfsp, _ijava_state_neg(top_frame_sp), scratch); + // Derelativize top_frame_sp + sldi(tfsp, tfsp, Interpreter::logStackElementSize); + add(tfsp, tfsp, scratch); resize_frame_absolute(tfsp, scratch2, R0); } ld(R14_bcp, _ijava_state_neg(bcp), scratch); // Changed by VM code (exception). diff --git a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp index 50d43a46d40..e3a8b3fbd94 100644 --- a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp @@ -1061,8 +1061,10 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist __ std(R0, _ijava_state_neg(oop_tmp), R1_SP); // only used for native_call // Store sender's SP and this frame's top SP. - __ subf(R12_scratch2, Rtop_frame_size, R1_SP); __ std(R21_sender_SP, _ijava_state_neg(sender_sp), R1_SP); + __ neg(R12_scratch2, Rtop_frame_size); + __ sradi(R12_scratch2, R12_scratch2, Interpreter::logStackElementSize); + // Store relativized top_frame_sp __ std(R12_scratch2, _ijava_state_neg(top_frame_sp), R1_SP); // Push top frame. diff --git a/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp b/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp index 5bfa1a8756c..c581871fd8e 100644 --- a/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp @@ -82,7 +82,7 @@ template frame FreezeBase::new_heap_frame(frame& f, frame& calle intptr_t *sp, *fp; // sp is really our unextended_sp if (FKind::interpreted) { assert((intptr_t*)f.at(frame::interpreter_frame_last_sp_offset) == nullptr - || f.unextended_sp() == (intptr_t*)f.at(frame::interpreter_frame_last_sp_offset), ""); + || f.unextended_sp() == (intptr_t*)f.at_relative(frame::interpreter_frame_last_sp_offset), ""); intptr_t locals_offset = *f.addr_at(frame::interpreter_frame_locals_offset); // If the caller.is_empty(), i.e. we're freezing into an empty chunk, then we set // the chunk's argsize in finalize_freeze and make room for it above the unextended_sp @@ -121,7 +121,7 @@ template frame FreezeBase::new_heap_frame(frame& f, frame& calle void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) { assert((f.at(frame::interpreter_frame_last_sp_offset) != 0) || (f.unextended_sp() == f.sp()), ""); - intptr_t* real_unextended_sp = (intptr_t*)f.at(frame::interpreter_frame_last_sp_offset); + intptr_t* real_unextended_sp = (intptr_t*)f.at_relative_or_null(frame::interpreter_frame_last_sp_offset); if (real_unextended_sp != nullptr) { f.set_unextended_sp(real_unextended_sp); // can be null at a safepoint } @@ -147,8 +147,8 @@ inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, co // because we freeze the padding word (see recurse_freeze_interpreted_frame) in order to keep the same relativized // locals value, we don't need to change the locals value here. - // at(frame::interpreter_frame_last_sp_offset) can be null at safepoint preempts - *hf.addr_at(frame::interpreter_frame_last_sp_offset) = hf.unextended_sp() - hf.fp(); + // Make sure that last_sp is already relativized. + assert((intptr_t*)hf.at_relative(frame::interpreter_frame_last_sp_offset) == hf.unextended_sp(), ""); relativize_one(vfp, hfp, frame::interpreter_frame_initial_sp_offset); // == block_top == block_bottom relativize_one(vfp, hfp, frame::interpreter_frame_extended_sp_offset); @@ -292,7 +292,9 @@ static inline void derelativize_one(intptr_t* const fp, int offset) { inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, const frame& f) { intptr_t* vfp = f.fp(); - derelativize_one(vfp, frame::interpreter_frame_last_sp_offset); + // Make sure that last_sp is kept relativized. + assert((intptr_t*)f.at_relative(frame::interpreter_frame_last_sp_offset) == f.unextended_sp(), ""); + derelativize_one(vfp, frame::interpreter_frame_initial_sp_offset); derelativize_one(vfp, frame::interpreter_frame_extended_sp_offset); } diff --git a/src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp b/src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp index 58ca64f23e7..4e96a8231b1 100644 --- a/src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp @@ -125,7 +125,8 @@ inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, assert(res == (intptr_t*)f.interpreter_frame_monitor_end() - expression_stack_sz, ""); assert(res >= f.unextended_sp(), "res: " INTPTR_FORMAT " initial_sp: " INTPTR_FORMAT " last_sp: " INTPTR_FORMAT " unextended_sp: " INTPTR_FORMAT " expression_stack_size: %d", - p2i(res), p2i(f.addr_at(frame::interpreter_frame_initial_sp_offset)), f.at(frame::interpreter_frame_last_sp_offset), p2i(f.unextended_sp()), expression_stack_sz); + p2i(res), p2i(f.addr_at(frame::interpreter_frame_initial_sp_offset)), f.at_relative_or_null(frame::interpreter_frame_last_sp_offset), + p2i(f.unextended_sp()), expression_stack_sz); return res; } diff --git a/src/hotspot/cpu/riscv/frame_riscv.cpp b/src/hotspot/cpu/riscv/frame_riscv.cpp index f1518724608..e91b722bd02 100644 --- a/src/hotspot/cpu/riscv/frame_riscv.cpp +++ b/src/hotspot/cpu/riscv/frame_riscv.cpp @@ -331,7 +331,9 @@ void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) { // Used by template based interpreter deoptimization void frame::interpreter_frame_set_last_sp(intptr_t* last_sp) { - *((intptr_t**)addr_at(interpreter_frame_last_sp_offset)) = last_sp; + assert(is_interpreted_frame(), "interpreted frame expected"); + // set relativized last_sp + ptr_at_put(interpreter_frame_last_sp_offset, last_sp != nullptr ? (last_sp - fp()) : 0); } void frame::interpreter_frame_set_extended_sp(intptr_t* sp) { diff --git a/src/hotspot/cpu/riscv/frame_riscv.inline.hpp b/src/hotspot/cpu/riscv/frame_riscv.inline.hpp index 40455805984..dfec3880192 100644 --- a/src/hotspot/cpu/riscv/frame_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/frame_riscv.inline.hpp @@ -253,7 +253,9 @@ inline intptr_t* frame::interpreter_frame_locals() const { } inline intptr_t* frame::interpreter_frame_last_sp() const { - return (intptr_t*)at(interpreter_frame_last_sp_offset); + intptr_t n = *addr_at(interpreter_frame_last_sp_offset); + assert(n <= 0, "n: " INTPTR_FORMAT, n); + return n != 0 ? &fp()[n] : nullptr; } inline intptr_t* frame::interpreter_frame_bcp_addr() const { diff --git a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp index b8e155ccbba..96bbd6a3f30 100644 --- a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp +++ b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp @@ -491,7 +491,9 @@ void InterpreterMacroAssembler::prepare_to_jump_from_interpreted() { // set sender sp mv(x19_sender_sp, sp); // record last_sp - sd(esp, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); + sub(t0, esp, fp); + srai(t0, t0, Interpreter::logStackElementSize); + sd(t0, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); } // Jump to from_interpreted entry of a call unless single stepping is possible diff --git a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp index aeb9d58f670..ef6675eeebd 100644 --- a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp @@ -426,7 +426,8 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, address entry = __ pc(); // Restore stack bottom in case i2c adjusted stack - __ ld(esp, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ ld(t0, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ shadd(esp, t0, fp, t0, LogBytesPerWord); // and null it as marker that esp is now tos until next java call __ sd(zr, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); __ restore_bcp(); @@ -483,7 +484,8 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, __ restore_sp_after_call(); // Restore SP to extended SP // Restore expression stack pointer - __ ld(esp, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ ld(t0, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ shadd(esp, t0, fp, t0, LogBytesPerWord); // null last_sp until next java call __ sd(zr, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); @@ -1604,7 +1606,8 @@ void TemplateInterpreterGenerator::generate_throw_exception() { /* notify_jvmdi */ false); // Restore the last_sp and null it out - __ ld(esp, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ ld(t0, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ shadd(esp, t0, fp, t0, LogBytesPerWord); __ sd(zr, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize)); __ restore_bcp(); diff --git a/src/hotspot/cpu/x86/continuationFreezeThaw_x86.inline.hpp b/src/hotspot/cpu/x86/continuationFreezeThaw_x86.inline.hpp index 08b1b285651..8630a4670db 100644 --- a/src/hotspot/cpu/x86/continuationFreezeThaw_x86.inline.hpp +++ b/src/hotspot/cpu/x86/continuationFreezeThaw_x86.inline.hpp @@ -79,8 +79,8 @@ frame FreezeBase::new_heap_frame(frame& f, frame& caller) { intptr_t *sp, *fp; // sp is really our unextended_sp if (FKind::interpreted) { - assert((intptr_t*)f.at(frame::interpreter_frame_last_sp_offset) == nullptr - || f.unextended_sp() == (intptr_t*)f.at(frame::interpreter_frame_last_sp_offset), ""); + assert((intptr_t*)f.at_relative_or_null(frame::interpreter_frame_last_sp_offset) == nullptr + || f.unextended_sp() == (intptr_t*)f.at_relative(frame::interpreter_frame_last_sp_offset), ""); intptr_t locals_offset = *f.addr_at(frame::interpreter_frame_locals_offset); // If the caller.is_empty(), i.e. we're freezing into an empty chunk, then we set // the chunk's argsize in finalize_freeze and make room for it above the unextended_sp @@ -120,7 +120,7 @@ frame FreezeBase::new_heap_frame(frame& f, frame& caller) { void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) { assert((f.at(frame::interpreter_frame_last_sp_offset) != 0) || (f.unextended_sp() == f.sp()), ""); - intptr_t* real_unextended_sp = (intptr_t*)f.at(frame::interpreter_frame_last_sp_offset); + intptr_t* real_unextended_sp = (intptr_t*)f.at_relative_or_null(frame::interpreter_frame_last_sp_offset); if (real_unextended_sp != nullptr) { f.set_unextended_sp(real_unextended_sp); // can be null at a safepoint } @@ -141,8 +141,8 @@ inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, co || (f.unextended_sp() == f.sp()), ""); assert(f.fp() > (intptr_t*)f.at(frame::interpreter_frame_initial_sp_offset), ""); - // at(frame::interpreter_frame_last_sp_offset) can be null at safepoint preempts - *hf.addr_at(frame::interpreter_frame_last_sp_offset) = hf.unextended_sp() - hf.fp(); + // Make sure that last_sp is already relativized. + assert((intptr_t*)hf.at_relative(frame::interpreter_frame_last_sp_offset) == hf.unextended_sp(), ""); // Make sure that locals is already relativized. assert((*hf.addr_at(frame::interpreter_frame_locals_offset) == frame::sender_sp_offset + f.interpreter_frame_method()->max_locals() - 1), ""); @@ -282,7 +282,9 @@ static inline void derelativize_one(intptr_t* const fp, int offset) { inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, const frame& f) { intptr_t* vfp = f.fp(); - derelativize_one(vfp, frame::interpreter_frame_last_sp_offset); + // Make sure that last_sp is kept relativized. + assert((intptr_t*)f.at_relative(frame::interpreter_frame_last_sp_offset) == f.unextended_sp(), ""); + derelativize_one(vfp, frame::interpreter_frame_initial_sp_offset); } diff --git a/src/hotspot/cpu/x86/continuationHelper_x86.inline.hpp b/src/hotspot/cpu/x86/continuationHelper_x86.inline.hpp index 0b226b4b581..55794f9ac7e 100644 --- a/src/hotspot/cpu/x86/continuationHelper_x86.inline.hpp +++ b/src/hotspot/cpu/x86/continuationHelper_x86.inline.hpp @@ -125,7 +125,8 @@ inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, assert(res == (intptr_t*)f.interpreter_frame_monitor_end() - expression_stack_sz, ""); assert(res >= f.unextended_sp(), "res: " INTPTR_FORMAT " initial_sp: " INTPTR_FORMAT " last_sp: " INTPTR_FORMAT " unextended_sp: " INTPTR_FORMAT " expression_stack_size: %d", - p2i(res), p2i(f.addr_at(frame::interpreter_frame_initial_sp_offset)), f.at(frame::interpreter_frame_last_sp_offset), p2i(f.unextended_sp()), expression_stack_sz); + p2i(res), p2i(f.addr_at(frame::interpreter_frame_initial_sp_offset)), f.at_relative_or_null(frame::interpreter_frame_last_sp_offset), + p2i(f.unextended_sp()), expression_stack_sz); return res; } diff --git a/src/hotspot/cpu/x86/frame_x86.cpp b/src/hotspot/cpu/x86/frame_x86.cpp index 7e4b24e097d..0fc674ec69b 100644 --- a/src/hotspot/cpu/x86/frame_x86.cpp +++ b/src/hotspot/cpu/x86/frame_x86.cpp @@ -352,7 +352,9 @@ void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) { // Used by template based interpreter deoptimization void frame::interpreter_frame_set_last_sp(intptr_t* sp) { - *((intptr_t**)addr_at(interpreter_frame_last_sp_offset)) = sp; + assert(is_interpreted_frame(), "interpreted frame expected"); + // set relativized last_sp + ptr_at_put(interpreter_frame_last_sp_offset, sp != nullptr ? (sp - fp()) : 0); } frame frame::sender_for_entry_frame(RegisterMap* map) const { diff --git a/src/hotspot/cpu/x86/frame_x86.inline.hpp b/src/hotspot/cpu/x86/frame_x86.inline.hpp index d7862afc292..67e5a1e0c43 100644 --- a/src/hotspot/cpu/x86/frame_x86.inline.hpp +++ b/src/hotspot/cpu/x86/frame_x86.inline.hpp @@ -250,7 +250,9 @@ inline intptr_t* frame::interpreter_frame_locals() const { } inline intptr_t* frame::interpreter_frame_last_sp() const { - return (intptr_t*)at(interpreter_frame_last_sp_offset); + intptr_t n = *addr_at(interpreter_frame_last_sp_offset); + assert(n <= 0, "n: " INTPTR_FORMAT, n); + return n != 0 ? &fp()[n] : nullptr; } inline intptr_t* frame::interpreter_frame_bcp_addr() const { diff --git a/src/hotspot/cpu/x86/interp_masm_x86.cpp b/src/hotspot/cpu/x86/interp_masm_x86.cpp index caa07857f03..e5b5aeebeca 100644 --- a/src/hotspot/cpu/x86/interp_masm_x86.cpp +++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp @@ -795,7 +795,10 @@ void InterpreterMacroAssembler::prepare_to_jump_from_interpreted() { // set sender sp lea(_bcp_register, Address(rsp, wordSize)); // record last_sp - movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), _bcp_register); + mov(rcx, _bcp_register); + subptr(rcx, rbp); + sarptr(rcx, LogBytesPerWord); + movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), rcx); } diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp index 6bf129a2b34..ed905b1fd99 100644 --- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp +++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp @@ -206,7 +206,8 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, #endif // _LP64 // Restore stack bottom in case i2c adjusted stack - __ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ movptr(rcx, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ lea(rsp, Address(rbp, rcx, Address::times_ptr)); // and null it as marker that esp is now tos until next java call __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); @@ -1616,6 +1617,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() { #ifndef _LP64 __ mov(rax, rsp); __ movptr(rbx, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ lea(rbx, Address(rbp, rbx, Address::times_ptr)); __ get_thread(thread); // PC must point into interpreter here __ set_last_Java_frame(thread, noreg, rbp, __ pc(), noreg); @@ -1624,6 +1626,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() { #else __ mov(c_rarg1, rsp); __ movptr(c_rarg2, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ lea(c_rarg2, Address(rbp, c_rarg2, Address::times_ptr)); // PC must point into interpreter here __ set_last_Java_frame(noreg, rbp, __ pc(), rscratch1); __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::popframe_move_outgoing_args), r15_thread, c_rarg1, c_rarg2); @@ -1631,7 +1634,8 @@ void TemplateInterpreterGenerator::generate_throw_exception() { __ reset_last_Java_frame(thread, true); // Restore the last_sp and null it out - __ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ movptr(rcx, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); + __ lea(rsp, Address(rbp, rcx, Address::times_ptr)); __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); __ restore_bcp(); diff --git a/src/hotspot/share/runtime/frame.cpp b/src/hotspot/share/runtime/frame.cpp index c0d6238f053..f4893bae5db 100644 --- a/src/hotspot/share/runtime/frame.cpp +++ b/src/hotspot/share/runtime/frame.cpp @@ -1612,10 +1612,10 @@ void FrameValues::print_on(stackChunkOop chunk, outputStream* st) { while (!(start <= v0 && v0 <= end)) v0 = _values.at(++min_index).location; while (!(start <= v1 && v1 <= end)) v1 = _values.at(--max_index).location; - print_on(st, min_index, max_index, v0, v1, true /* on_heap */); + print_on(st, min_index, max_index, v0, v1); } -void FrameValues::print_on(outputStream* st, int min_index, int max_index, intptr_t* v0, intptr_t* v1, bool on_heap) { +void FrameValues::print_on(outputStream* st, int min_index, int max_index, intptr_t* v0, intptr_t* v1) { intptr_t* min = MIN2(v0, v1); intptr_t* max = MAX2(v0, v1); intptr_t* cur = max; @@ -1630,8 +1630,7 @@ void FrameValues::print_on(outputStream* st, int min_index, int max_index, intpt const char* spacer = " " LP64_ONLY(" "); st->print_cr(" %s %s %s", spacer, spacer, fv.description); } else { - if (on_heap - && *fv.location != 0 && *fv.location > -100 && *fv.location < 100 + if (*fv.location != 0 && *fv.location > -100 && *fv.location < 100 #if !defined(PPC64) && (strncmp(fv.description, "interpreter_frame_", 18) == 0 || strstr(fv.description, " method ")) #else // !defined(PPC64) diff --git a/src/hotspot/share/runtime/frame.hpp b/src/hotspot/share/runtime/frame.hpp index fcfb51c008b..60869dfd09d 100644 --- a/src/hotspot/share/runtime/frame.hpp +++ b/src/hotspot/share/runtime/frame.hpp @@ -249,6 +249,12 @@ class frame { // Interpreter frames in continuation stacks are on the heap, and internal addresses are relative to fp. intptr_t at_relative(int index) const { return (intptr_t)(fp() + fp()[index]); } + intptr_t at_relative_or_null(int index) const { + return (fp()[index] != 0) + ? (intptr_t)(fp() + fp()[index]) + : 0; + } + intptr_t at(int index) const { return _on_heap ? at_relative(index) : at_absolute(index); } @@ -519,8 +525,7 @@ class FrameValues { return checked_cast(a->location - b->location); } - void print_on(outputStream* out, int min_index, int max_index, intptr_t* v0, intptr_t* v1, - bool on_heap = false); + void print_on(outputStream* out, int min_index, int max_index, intptr_t* v0, intptr_t* v1); public: // Used by frame functions to describe locations. From bcba5e97857fd57ea4571341ad40194bb823cd0b Mon Sep 17 00:00:00 2001 From: Fredrik Bredberg Date: Fri, 18 Aug 2023 14:33:03 +0000 Subject: [PATCH 111/162] 8313419: Template interpreter produces no safepoint check for return bytecodes Reviewed-by: pchilanomate --- src/hotspot/cpu/aarch64/templateTable_aarch64.cpp | 12 ++++++++++++ src/hotspot/cpu/arm/templateTable_arm.cpp | 10 ++++++++++ src/hotspot/cpu/riscv/templateTable_riscv.cpp | 13 +++++++++++++ 3 files changed, 35 insertions(+) diff --git a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp index 5d57505ddc5..0495f766bab 100644 --- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp @@ -2205,6 +2205,18 @@ void TemplateTable::_return(TosState state) if (_desc->bytecode() == Bytecodes::_return) __ membar(MacroAssembler::StoreStore); + if (_desc->bytecode() != Bytecodes::_return_register_finalizer) { + Label no_safepoint; + __ ldr(rscratch1, Address(rthread, JavaThread::polling_word_offset())); + __ tbz(rscratch1, log2i_exact(SafepointMechanism::poll_bit()), no_safepoint); + __ push(state); + __ push_cont_fastpath(rthread); + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)); + __ pop_cont_fastpath(rthread); + __ pop(state); + __ bind(no_safepoint); + } + // Narrow result if state is itos but result type is smaller. // Need to narrow in the return bytecode rather than in generate_return_entry // since compiled code callers expect the result to already be narrowed. diff --git a/src/hotspot/cpu/arm/templateTable_arm.cpp b/src/hotspot/cpu/arm/templateTable_arm.cpp index 263ff4f9e8b..b8f1fdeebda 100644 --- a/src/hotspot/cpu/arm/templateTable_arm.cpp +++ b/src/hotspot/cpu/arm/templateTable_arm.cpp @@ -2492,6 +2492,16 @@ void TemplateTable::_return(TosState state) { __ bind(skip_register_finalizer); } + if (_desc->bytecode() != Bytecodes::_return_register_finalizer) { + Label no_safepoint; + __ ldr(Rtemp, Address(Rthread, JavaThread::polling_word_offset())); + __ tbz(Rtemp, exact_log2(SafepointMechanism::poll_bit()), no_safepoint); + __ push(state); + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)); + __ pop(state); + __ bind(no_safepoint); + } + // Narrow result if state is itos but result type is smaller. // Need to narrow in the return bytecode rather than in generate_return_entry // since compiled code callers expect the result to already be narrowed. diff --git a/src/hotspot/cpu/riscv/templateTable_riscv.cpp b/src/hotspot/cpu/riscv/templateTable_riscv.cpp index 87efd3522d9..c85f2b97b1a 100644 --- a/src/hotspot/cpu/riscv/templateTable_riscv.cpp +++ b/src/hotspot/cpu/riscv/templateTable_riscv.cpp @@ -2114,6 +2114,19 @@ void TemplateTable::_return(TosState state) { __ membar(MacroAssembler::StoreStore); } + if (_desc->bytecode() != Bytecodes::_return_register_finalizer) { + Label no_safepoint; + __ ld(t0, Address(xthread, JavaThread::polling_word_offset())); + __ test_bit(t0, t0, exact_log2(SafepointMechanism::poll_bit())); + __ beqz(t0, no_safepoint); + __ push(state); + __ push_cont_fastpath(xthread); + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)); + __ pop_cont_fastpath(xthread); + __ pop(state); + __ bind(no_safepoint); + } + // Narrow result if state is itos but result type is smaller. // Need to narrow in the return bytecode rather than in generate_return_entry // since compiled code callers expect the result to already be narrowed. From aecbb1b5c3ea4919f09ce98a6f5a58db6e630d29 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Fri, 18 Aug 2023 16:40:51 +0000 Subject: [PATCH 112/162] 8314448: Coordinate DocLint and JavaDoc to report on unknown tags Reviewed-by: jjg --- .../formats/html/taglets/TagletManager.java | 129 +++++++++--------- .../jdk/javadoc/internal/doclint/Checker.java | 5 +- .../TestAutoLoadTaglets.java | 4 +- .../testUknownTags/TestUnknownTags.java | 106 ++++++++++++++ 4 files changed, 176 insertions(+), 68 deletions(-) create mode 100644 test/langtools/jdk/javadoc/doclet/testUknownTags/TestUnknownTags.java diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletManager.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletManager.java index 392678be6d3..ed3727fd5bb 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletManager.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletManager.java @@ -50,8 +50,10 @@ import javax.tools.JavaFileManager; import javax.tools.StandardJavaFileManager; +import com.sun.source.doctree.BlockTagTree; import com.sun.source.doctree.DocTree; +import com.sun.source.doctree.InlineTagTree; import jdk.javadoc.doclet.Doclet; import jdk.javadoc.doclet.DocletEnvironment; import jdk.javadoc.doclet.Taglet.Location; @@ -349,89 +351,88 @@ void seenTag(String name) { * @param trees the trees containing the comments */ public void checkTags(Element element, Iterable trees) { - CommentHelper ch = utils.getCommentHelper(element); for (DocTree tag : trees) { - String name = tag.getKind().tagName; + String name = switch (tag.getKind()) { + case UNKNOWN_INLINE_TAG -> ((InlineTagTree) tag).getTagName(); + case UNKNOWN_BLOCK_TAG -> ((BlockTagTree) tag).getTagName(); + default -> tag.getKind().tagName; + }; if (name == null) { - continue; + continue; // not a tag } - if (!name.isEmpty() && name.charAt(0) == '@') { - name = name.substring(1); - } - if (! (standardTags.contains(name) || allTaglets.containsKey(name))) { // defunct, see 8314213 - if (standardTagsLowercase.contains(Utils.toLowerCase(name))) { - messages.warning(ch.getDocTreePath(tag), "doclet.UnknownTagLowercase", ch.getTagName(tag)); - continue; - } else { - messages.warning(ch.getDocTreePath(tag), "doclet.UnknownTag", ch.getTagName(tag)); - continue; + if (!allTaglets.containsKey(name)) { + if (!config.isDocLintSyntaxGroupEnabled()) { + var ch = utils.getCommentHelper(element); + if (standardTagsLowercase.contains(Utils.toLowerCase(name))) { + messages.warning(ch.getDocTreePath(tag), "doclet.UnknownTagLowercase", ch.getTagName(tag)); + } else { + messages.warning(ch.getDocTreePath(tag), "doclet.UnknownTag", ch.getTagName(tag)); + } } + continue; // unknown tag } final Taglet taglet = allTaglets.get(name); - // Check and verify tag usage - if (taglet != null) { - if (taglet instanceof SimpleTaglet st && !st.isEnabled()) { - // taglet has been disabled - return; - } + if (taglet instanceof SimpleTaglet st && !st.isEnabled()) { + continue; // taglet has been disabled + } - new SimpleElementVisitor14() { - @Override - public Void visitModule(ModuleElement e, Void p) { - if (!taglet.inModule()) { - printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "module"); - } - return null; + // Check and verify tag usage + new SimpleElementVisitor14() { + @Override + public Void visitModule(ModuleElement e, Void p) { + if (!taglet.inModule()) { + printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "module"); } + return null; + } - @Override - public Void visitPackage(PackageElement e, Void p) { - if (!taglet.inPackage()) { - printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "package"); - } - return null; + @Override + public Void visitPackage(PackageElement e, Void p) { + if (!taglet.inPackage()) { + printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "package"); } + return null; + } - @Override - public Void visitType(TypeElement e, Void p) { - if (!taglet.inType()) { - printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "class"); - } - return null; + @Override + public Void visitType(TypeElement e, Void p) { + if (!taglet.inType()) { + printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "class"); } + return null; + } - @Override - public Void visitExecutable(ExecutableElement e, Void p) { - if (utils.isConstructor(e) && !taglet.inConstructor()) { - printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "constructor"); - } else if (!taglet.inMethod()) { - printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "method"); - } - return null; + @Override + public Void visitExecutable(ExecutableElement e, Void p) { + if (utils.isConstructor(e) && !taglet.inConstructor()) { + printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "constructor"); + } else if (!taglet.inMethod()) { + printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "method"); } + return null; + } - @Override - public Void visitVariable(VariableElement e, Void p) { - if (utils.isField(e) && !taglet.inField()) { - printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "field"); - } - return null; + @Override + public Void visitVariable(VariableElement e, Void p) { + if (utils.isField(e) && !taglet.inField()) { + printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "field"); } + return null; + } - @Override - public Void visitUnknown(Element e, Void p) { - if (utils.isOverviewElement(e) && !taglet.inOverview()) { - printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "overview"); - } - return null; + @Override + public Void visitUnknown(Element e, Void p) { + if (utils.isOverviewElement(e) && !taglet.inOverview()) { + printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "overview"); } + return null; + } - @Override - protected Void defaultAction(Element e, Void p) { - return null; - } - }.visit(element); - } + @Override + protected Void defaultAction(Element e, Void p) { + return null; + } + }.visit(element); } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java index 2f5631adbc9..a0fad5a0e7d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java @@ -1142,8 +1142,9 @@ public Void visitUnknownInlineTag(UnknownInlineTagTree tree, Void ignore) { private void checkUnknownTag(DocTree tree, String tagName) { // if it were a standard tag, this method wouldn't be called: // a standard tag is never represented by Unknown{Block,Inline}TagTree - assert tree instanceof UnknownBlockTagTree - || tree instanceof UnknownInlineTagTree; + var k = tree.getKind(); + assert k == DocTree.Kind.UNKNOWN_BLOCK_TAG + || k == DocTree.Kind.UNKNOWN_INLINE_TAG; assert !getStandardTags().contains(tagName); // report an unknown tag only if custom tags are set, see 8314213 if (env.customTags != null && !env.customTags.contains(tagName)) diff --git a/test/langtools/jdk/javadoc/doclet/testAutoLoadTaglets/TestAutoLoadTaglets.java b/test/langtools/jdk/javadoc/doclet/testAutoLoadTaglets/TestAutoLoadTaglets.java index c4d160d2d87..ec99e5781f1 100644 --- a/test/langtools/jdk/javadoc/doclet/testAutoLoadTaglets/TestAutoLoadTaglets.java +++ b/test/langtools/jdk/javadoc/doclet/testAutoLoadTaglets/TestAutoLoadTaglets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,7 +110,7 @@ public class Taglet""" + i + """ \simplements Taglet { @Override public Set getAllowedLocations() { - return null; + return Set.of(); } @Override public boolean isInlineTag() { diff --git a/test/langtools/jdk/javadoc/doclet/testUknownTags/TestUnknownTags.java b/test/langtools/jdk/javadoc/doclet/testUknownTags/TestUnknownTags.java new file mode 100644 index 00000000000..d036e605d56 --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testUknownTags/TestUnknownTags.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8314448 + * @library /tools/lib ../../lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.javadoc/jdk.javadoc.internal.tool + * @build toolbox.ToolBox javadoc.tester.* + * @run main TestUnknownTags + */ + +import java.nio.file.Path; + +import javadoc.tester.JavadocTester; +import toolbox.ToolBox; + +public class TestUnknownTags extends JavadocTester { + + public static void main(String... args) throws Exception { + new TestUnknownTags().runTests(); + } + + private final ToolBox tb = new ToolBox(); + + // DocLint or not, there should be exactly one diagnostic message about + // an unknown tag. No doubled, no "swallowed" messages, just one. + @Test + public void testExactlyOneMessage(Path base) throws Exception { + var src = base.resolve("src"); + tb.writeJavaFiles(src, """ + package x; + + /** @mytag */ + public class MyClass { } + """); + // don't check exit status: we don't care if it's an error or warning + + // DocLint is explicit + int i = 0; + for (var check : new String[]{":all", ":none", ""}) { + var outputDir = "out-DocLint-" + i++; // use separate output directories + javadoc("-Xdoclint" + check, + "-d", base.resolve(outputDir).toString(), + "--source-path", src.toString(), + "x"); + new OutputChecker(Output.OUT) + .setExpectFound(true) + .checkUnique("unknown tag"); + } + // DocLint is default + javadoc("-d", base.resolve("out").toString(), + "--source-path", src.toString(), + "x"); + new OutputChecker(Output.OUT) + .setExpectFound(true) + .checkUnique("unknown tag"); + } + + // Disabled simple tags are treated as known tags, but aren't checked + // for misuse. Additionally, they don't prevent other tags from being + // checked. + @Test + public void testDisabledSimpleTags(Path base) throws Exception { + var src = base.resolve("src"); + tb.writeJavaFiles(src, """ + package x; + + /** + * @myDisabledTag foo + * @myEnabledTag bar + */ + public class MyClass extends RuntimeException { } + """); + javadoc("-d", base.resolve("out").toString(), + "-sourcepath", src.toString(), + "-tag", "myDisabledTag:mX:Disabled Tag", // may appear in methods; disabled + "-tag", "myEnabledTag:mf:Enabled Tag", // may appear in method and fields; enabled + "x"); + checkOutput(Output.OUT, false, "unknown tag"); + checkOutput(Output.OUT, false, "Tag @myDisabledTag cannot be used in class documentation"); + checkOutput(Output.OUT, true, "Tag @myEnabledTag cannot be used in class documentation"); + } +} From 50a2ce01f4d1d42d7a537b48a669b5a75a583df5 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Fri, 18 Aug 2023 17:10:39 +0000 Subject: [PATCH 113/162] 8310815: Clarify the name of the main class, services and provider classes in module descriptor 8314449: Clarify the name of the declaring class of StackTraceElement Reviewed-by: alanb --- .../classes/java/lang/StackTraceElement.java | 20 ++++++++-------- .../java/lang/module/ModuleDescriptor.java | 23 +++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/java.base/share/classes/java/lang/StackTraceElement.java b/src/java.base/share/classes/java/lang/StackTraceElement.java index fc39291b316..9b87d2ae7cd 100644 --- a/src/java.base/share/classes/java/lang/StackTraceElement.java +++ b/src/java.base/share/classes/java/lang/StackTraceElement.java @@ -102,8 +102,9 @@ public final class StackTraceElement implements java.io.Serializable { * #getModuleVersion module version} of the stack trace element will * be {@code null}. * - * @param declaringClass the fully qualified name of the class containing - * the execution point represented by the stack trace element + * @param declaringClass the {@linkplain ClassLoader##binary-name binary name} + * of the class containing the execution point represented by + * the stack trace element * @param methodName the name of the method containing the execution point * represented by the stack trace element * @param fileName the name of the file containing the execution point @@ -137,8 +138,9 @@ public StackTraceElement(String declaringClass, String methodName, * @param moduleVersion the module version if the class containing the * execution point represented by the stack trace is in a named * module that has a version; otherwise {@code null} - * @param declaringClass the fully qualified name of the class containing - * the execution point represented by the stack trace element + * @param declaringClass the {@linkplain ClassLoader##binary-name binary name} + * of the class containing the execution point represented by + * the stack trace element * @param methodName the name of the method containing the execution point * represented by the stack trace element * @param fileName the name of the file containing the execution point @@ -249,11 +251,9 @@ public String getClassLoaderName() { } /** - * Returns the fully qualified name of the class containing the - * execution point represented by this stack trace element. - * - * @return the fully qualified name of the {@code Class} containing - * the execution point represented by this stack trace element. + * {@return the {@linkplain ClassLoader##binary-name binary name} + * of the {@code Class} containing the execution point represented + * by this stack trace element} */ public String getClassName() { return declaringClass; @@ -332,7 +332,7 @@ public boolean isNativeMethod() { * the name of the class loader. The second element "{@code foo@9.0}" * is the module name and version. The third element is the method * containing the execution point; "{@code com.foo.Main"}" is the - * fully-qualified class name and "{@code run}" is the name of the method. + * binary name and "{@code run}" is the name of the method. * "{@code Main.java}" is the source file name and "{@code 101}" is * the line number. * diff --git a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java index 3972084eca2..b38d1b0cc87 100644 --- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java +++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java @@ -847,26 +847,25 @@ private Provides(String service, List providers, boolean unused) { } /** - * Returns the fully qualified class name of the service type. - * - * @return The fully qualified class name of the service type + * {@return the {@linkplain ClassLoader##binary-name binary name} of the service type} */ public String service() { return service; } /** - * Returns the list of the fully qualified class names of the providers - * or provider factories. + * Returns the list of the {@linkplain ClassLoader##binary-name binary names} + * of the providers or provider factories. * - * @return A non-empty and unmodifiable list of the fully qualified class - * names of the providers or provider factories + * @return A non-empty and unmodifiable list of the {@linkplain ClassLoader##binary-name + * binary names} of the providers or provider factories */ public List providers() { return providers; } /** * Compares this {@code Provides} to another. * - *

    Two {@code Provides} objects are compared by comparing the fully - * qualified class name of the service type lexicographically. Where the + *

    Two {@code Provides} objects are compared by comparing the + * {@linkplain ClassLoader##binary-name binary name} + * of the service type lexicographically. Where the * class names are equal then the list of the provider class names are * compared by comparing the corresponding elements of both lists * lexicographically and in sequence. Where the lists differ in size, @@ -1446,8 +1445,8 @@ public Set opens() { *

    If this module is an automatic module then the set of service * dependences is empty.

    * - * @return A possibly-empty unmodifiable set of the fully qualified class - * names of the service types used + * @return A possibly-empty unmodifiable set of the {@linkplain ClassLoader##binary-name + * binary names} of the service types used */ public Set uses() { return uses; @@ -1510,7 +1509,7 @@ public String toNameAndVersion() { /** *

    Returns the module main class.

    * - * @return The fully qualified class name of the module's main class + * @return The {@linkplain ClassLoader##binary-name binary name} of the module's main class */ public Optional mainClass() { return Optional.ofNullable(mainClass); From fbe28ee90d018300259c1b515e340e60cbb30513 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Fri, 18 Aug 2023 17:46:36 +0000 Subject: [PATCH 114/162] 8314481: JDWPTRANSPORT_ERROR_INTERNAL code in socketTransport.c can never be executed Reviewed-by: dcubed, sspitsyn --- .../share/native/libdt_socket/socketTransport.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c index 4e49488da77..251154d9c2d 100644 --- a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c +++ b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c @@ -736,15 +736,10 @@ socketTransport_startListening(jdwpTransportEnv* env, const char* address, } if (listenAddr == NULL) { - // No address of preferred address family found, grab the fist one. + // No address of preferred address family found, grab the first one. listenAddr = &(addrInfo[0]); } - if (listenAddr == NULL) { - dbgsysFreeAddrInfo(addrInfo); - RETURN_ERROR(JDWPTRANSPORT_ERROR_INTERNAL, "listen failed: wrong address"); - } - // Binding to IN6ADDR_ANY allows to serve both IPv4 and IPv6 connections, // but binding to mapped INADDR_ANY (::ffff:0.0.0.0) allows to serve IPv4 // connections only. Make sure that IN6ADDR_ANY is preferred over From f481477144d25bf2b5ee44f202705588bd99d4f4 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Fri, 18 Aug 2023 17:53:07 +0000 Subject: [PATCH 115/162] 8314320: Mark runtime/CommandLine/ tests as flagless Reviewed-by: dholmes --- .../CommandLine/BooleanFlagWithInvalidValue.java | 3 ++- .../CommandLine/CompilerConfigFileWarning.java | 1 + .../jtreg/runtime/CommandLine/ConfigFileParsing.java | 3 ++- .../jtreg/runtime/CommandLine/ConfigFileWarning.java | 3 ++- .../CommandLine/DoubleFlagWithIntegerValue.java | 3 ++- .../runtime/CommandLine/FlagWithInvalidValue.java | 3 ++- .../CommandLine/IgnoreUnrecognizedVMOptions.java | 4 ++-- .../NonBooleanFlagWithInvalidBooleanPrefix.java | 3 ++- .../CommandLine/ObsoleteFlagErrorMessage.java | 3 ++- .../OptionsValidation/TestJcmdOutput.java | 3 ++- .../OptionsValidation/TestOptionsWithRanges.java | 12 +++++++++++- .../TestOptionsWithRangesDynamic.java | 3 ++- .../TestOptionsWithRanges_generate.sh | 5 +++-- .../jtreg/runtime/CommandLine/TestHexArguments.java | 3 ++- .../CommandLine/TestLongUnrecognizedVMOption.java | 3 ++- .../runtime/CommandLine/TestNullTerminatedFlags.java | 4 ++-- .../jtreg/runtime/CommandLine/TestVMOptions.java | 3 ++- .../runtime/CommandLine/TraceExceptionsTest.java | 3 ++- .../runtime/CommandLine/UnrecognizedVMOption.java | 3 ++- .../jtreg/runtime/CommandLine/VMAliasOptions.java | 3 ++- .../runtime/CommandLine/VMDeprecatedOptions.java | 3 ++- .../jtreg/runtime/CommandLine/VMOptionWarning.java | 3 ++- .../CommandLine/VMOptionsFile/TestVMOptionsFile.java | 3 ++- 23 files changed, 55 insertions(+), 25 deletions(-) diff --git a/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java b/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java index 0c59079bb8e..55278a67bc2 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java +++ b/test/hotspot/jtreg/runtime/CommandLine/BooleanFlagWithInvalidValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @bug 8006298 * @summary Setting an invalid value for a bool argument should result in a useful error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java b/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java index 028f50d253b..c1807e4b3ec 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java +++ b/test/hotspot/jtreg/runtime/CommandLine/CompilerConfigFileWarning.java @@ -25,6 +25,7 @@ * @test * @bug 7167142 * @summary Warn if unused .hotspot_compiler file is present + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java index b2b31ce6f75..471c71a0046 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java +++ b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileParsing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test ConfigFileParsing * @bug 7158804 * @summary Improve config file parsing + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java index 862ef4c9ce0..62aef23b580 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java +++ b/test/hotspot/jtreg/runtime/CommandLine/ConfigFileWarning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @bug 7167142 * @summary Warn if unused .hotspot_rc file is present + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java b/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java index 861160ee787..e24fd8f9ae0 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java +++ b/test/hotspot/jtreg/runtime/CommandLine/DoubleFlagWithIntegerValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test DoubleFlagWithIntegerValue * @bug 8178364 * @summary Command-line flags of type double should accept integer values + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java b/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java index 053aa1c850d..5cfc3497a94 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java +++ b/test/hotspot/jtreg/runtime/CommandLine/FlagWithInvalidValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @bug 8006298 * @summary Setting a flag to an invalid value should print a useful error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java b/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java index 0ebfdb56c4a..36f58fb3a97 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/IgnoreUnrecognizedVMOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ * @test * @bug 8129855 * @summary -XX:+IgnoreUnrecognizedVMOptions should work according to the spec from JDK-8129855 - * + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java b/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java index b1fff188907..0aead709245 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java +++ b/test/hotspot/jtreg/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @bug 8006298 * @summary Using a bool (+/-) prefix on non-bool flag should result in a useful error message + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java b/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java index 485d3cc57f5..8de8292611b 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java +++ b/test/hotspot/jtreg/runtime/CommandLine/ObsoleteFlagErrorMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ * @modules java.base/jdk.internal.misc * @library /test/lib * @requires vm.debug == true + * @requires vm.flagless * @run driver ObsoleteFlagErrorMessage */ diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java index b946945a800..b56cc376788 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @summary Verify jcmd error message for out-of-range value and for * value which is not allowed by constraint. Also check that * jcmd does not print an error message to the target process output. + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java index ffa88a9d009..a5d7a6bfa74 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (1 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -38,6 +39,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (2 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -49,6 +51,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (3 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -60,6 +63,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (4 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -71,6 +75,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (5 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -82,6 +87,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (6 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -93,6 +99,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (7 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -104,6 +111,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (8 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -115,6 +123,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (9 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management @@ -126,6 +135,7 @@ * @test * @bug 8205633 * @summary Test VM Options with ranges (10 of 10) + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java index 04bc2f76965..480e8929ff8 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRangesDynamic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /* * @test * @summary Test writeable VM Options with ranges. + * @requires vm.flagless * @library /test/lib /runtime/CommandLine/OptionsValidation/common * @modules java.base/jdk.internal.misc * jdk.attach/sun.tools.attach diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges_generate.sh b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges_generate.sh index 1fe8015c54d..73d8f2b31af 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges_generate.sh +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges_generate.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -24,12 +24,13 @@ echo "// --- start auto-generated" echo "// the following portion is auto-generated by $0. Do not edit manually." -for i in {1..10}; do +for i in {1..10}; do cat < Date: Fri, 18 Aug 2023 20:11:24 +0000 Subject: [PATCH 116/162] 8309475: Test java/foreign/TestByteBuffer.java fails: a problem with msync (aix) Reviewed-by: mbaesken, alanb, mdoerr --- .../aix/native/libnio/MappedMemoryUtils.c | 210 ++++++++++++++++++ .../unix/native/libnio/MappedMemoryUtils.c | 23 -- test/jdk/ProblemList.txt | 2 - 3 files changed, 210 insertions(+), 25 deletions(-) create mode 100644 src/java.base/aix/native/libnio/MappedMemoryUtils.c diff --git a/src/java.base/aix/native/libnio/MappedMemoryUtils.c b/src/java.base/aix/native/libnio/MappedMemoryUtils.c new file mode 100644 index 00000000000..51763e89082 --- /dev/null +++ b/src/java.base/aix/native/libnio/MappedMemoryUtils.c @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "jni.h" +#include "jni_util.h" +#include "jvm.h" +#include "jlong.h" +#include "java_nio_MappedMemoryUtils.h" +#include +#include +#include +#include +#include +#include +#include + +typedef char mincore_vec_t; + +static long calculate_number_of_pages_in_range(void* address, size_t len, size_t pagesize) { + uintptr_t address_unaligned = (uintptr_t) address; + uintptr_t address_aligned = address_unaligned & (~(pagesize - 1)); + size_t len2 = len + (address_unaligned - address_aligned); + long numPages = (len2 + pagesize - 1) / pagesize; + return numPages; +} + +JNIEXPORT jboolean JNICALL +Java_java_nio_MappedMemoryUtils_isLoaded0(JNIEnv *env, jobject obj, jlong address, + jlong len, jlong numPages) +{ + jboolean loaded = JNI_TRUE; + int result = 0; + long i = 0; + void *a = (void *) jlong_to_ptr(address); + mincore_vec_t* vec = NULL; + + /* See JDK-8186665 */ + size_t pagesize = (size_t)sysconf(_SC_PAGESIZE); + if ((long)pagesize == -1) { + return JNI_FALSE; + } + numPages = (jlong) calculate_number_of_pages_in_range(a, len, pagesize); + + /* Include space for one sentinel byte at the end of the buffer + * to catch overflows. */ + vec = (mincore_vec_t*) malloc(numPages + 1); + + if (vec == NULL) { + JNU_ThrowOutOfMemoryError(env, NULL); + return JNI_FALSE; + } + + vec[numPages] = '\x7f'; /* Write sentinel. */ + result = mincore(a, (size_t)len, vec); + assert(vec[numPages] == '\x7f'); /* Check sentinel. */ + + if (result == -1) { + JNU_ThrowIOExceptionWithLastError(env, "mincore failed"); + free(vec); + return JNI_FALSE; + } + + for (i=0; ipr_mflags & MA_SHARED) { + // MA_SHARED => MAP_SHARED => !MAP_PRIVATE. This error is valid and should be thrown. + JNU_ThrowIOExceptionWithMessageAndLastError(env, "msync with parameter MS_SYNC failed (MAP_SHARED)"); + return; + } else { + // O.W. MAP_PRIVATE or no flag was specified and EINVAL is the expected behaviour. + return; + } +} + +static void check_proc_map_array(JNIEnv* env, FILE* proc_file, prmap_t* map_entry, void* end_address) +{ + while (!feof(proc_file)) { + memset(map_entry, '\0', sizeof(prmap_t)); + fread((char*)map_entry, sizeof(prmap_t), 1, proc_file); + if (ferror(proc_file)) { + JNU_ThrowIOExceptionWithMessageAndLastError(env, + "msync with parameter MS_SYNC failed (could not read /proc//map)"); + return; + } else if (map_entry->pr_vaddr <= end_address && + (uint64_t)end_address <= (uint64_t)map_entry->pr_vaddr + map_entry->pr_size) { + set_error_if_shared(env, map_entry); + return; + } + } + JNU_ThrowIOExceptionWithMessageAndLastError(env, + "msync with parameter MS_SYNC failed (address not found)"); +} + +// '/proc/' + + '/map' + '\0' +#define PFNAME_LEN 32 +static void check_aix_einval(JNIEnv* env, void* end_address) +{ + // If EINVAL is set for a mmap address on AIX, additional validation is required. + // AIX will set EINVAL when msync is called on a mmap address that didn't receive MAP_SHARED + // as a flag (since MAP_PRIVATE is the default). + // https://www.ibm.com/docs/en/aix/7.2?topic=m-msync-subroutine + + FILE* proc_file; + { + char* fname = (char*) malloc(sizeof(char) * PFNAME_LEN); + pid_t the_pid = getpid(); + jio_snprintf(fname, PFNAME_LEN, "/proc/%d/map", the_pid); + proc_file = fopen(fname, "r"); + free(fname); + } + if (!proc_file) { + JNU_ThrowIOExceptionWithMessageAndLastError(env, + "msync with parameter MS_SYNC failed (could not open /proc//map)"); + return; + } + { + prmap_t* map_entry = (prmap_t*) malloc(sizeof(prmap_t)); + check_proc_map_array(env, proc_file, map_entry, end_address); + free(map_entry); + } + fclose(proc_file); +} + +// Normally we would just let msync handle this, but since we'll be (potentially) ignoring +// the error code returned by msync, we check the args before the call instead. +static int validate_msync_address(size_t address) +{ + size_t pagesize = (size_t)sysconf(_SC_PAGESIZE); + if (address % pagesize != 0) { + errno = EINVAL; + return -1; + } + return 0; +} + +JNIEXPORT void JNICALL +Java_java_nio_MappedMemoryUtils_force0(JNIEnv *env, jobject obj, jobject fdo, + jlong address, jlong len) +{ + void* a = (void *)jlong_to_ptr(address); + if (validate_msync_address((size_t)a) > 0) { + JNU_ThrowIOExceptionWithMessageAndLastError(env, + "msync with parameter MS_SYNC failed (arguments invalid)"); + return; + } + int result = msync(a, (size_t)len, MS_SYNC); + if (result == -1) { + void* end_address = (void*)jlong_to_ptr(address + len); + if (errno == EINVAL) { + check_aix_einval(env, end_address); + return; + } + JNU_ThrowIOExceptionWithMessageAndLastError(env, "msync with parameter MS_SYNC failed"); + } +} diff --git a/src/java.base/unix/native/libnio/MappedMemoryUtils.c b/src/java.base/unix/native/libnio/MappedMemoryUtils.c index 4c9b72e51ad..cdd8edff22a 100644 --- a/src/java.base/unix/native/libnio/MappedMemoryUtils.c +++ b/src/java.base/unix/native/libnio/MappedMemoryUtils.c @@ -33,10 +33,6 @@ #include #include -#ifdef _AIX -#include -#endif - /* Output type for mincore(2) */ #ifdef __linux__ typedef unsigned char mincore_vec_t; @@ -44,16 +40,6 @@ typedef unsigned char mincore_vec_t; typedef char mincore_vec_t; #endif -#ifdef _AIX -static long calculate_number_of_pages_in_range(void* address, size_t len, size_t pagesize) { - uintptr_t address_unaligned = (uintptr_t) address; - uintptr_t address_aligned = address_unaligned & (~(pagesize - 1)); - size_t len2 = len + (address_unaligned - address_aligned); - long numPages = (len2 + pagesize - 1) / pagesize; - return numPages; -} -#endif - JNIEXPORT jboolean JNICALL Java_java_nio_MappedMemoryUtils_isLoaded0(JNIEnv *env, jobject obj, jlong address, jlong len, jlong numPages) @@ -64,15 +50,6 @@ Java_java_nio_MappedMemoryUtils_isLoaded0(JNIEnv *env, jobject obj, jlong addres void *a = (void *) jlong_to_ptr(address); mincore_vec_t* vec = NULL; -#ifdef _AIX - /* See JDK-8186665 */ - size_t pagesize = (size_t)sysconf(_SC_PAGESIZE); - if ((long)pagesize == -1) { - return JNI_FALSE; - } - numPages = (jlong) calculate_number_of_pages_in_range(a, len, pagesize); -#endif - /* Include space for one sentinel byte at the end of the buffer * to catch overflows. */ vec = (mincore_vec_t*) malloc(numPages + 1); diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 24655fcb8c0..d0e7389094b 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -762,8 +762,6 @@ jdk/jfr/api/consumer/recordingstream/TestOnEvent.java 8255404 linux-x6 # jdk_foreign -java/foreign/TestByteBuffer.java 8309475 aix-ppc64 - ############################################################################ # Client manual tests From 58f5826ff48c20446a0c2ea44da107867126f638 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Sat, 19 Aug 2023 01:46:40 +0000 Subject: [PATCH 117/162] 8311222: strace004 can fail due to unexpected stack length after JDK-8309408 Reviewed-by: dholmes, alanb --- .../vmTestbase/nsk/monitoring/stress/thread/strace001.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java index 6267d6b5626..632cebae8f8 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/thread/strace001.java @@ -150,6 +150,7 @@ private static boolean fillTrace() { "java.lang.Thread.currentThread", "java.util.concurrent.TimeUnit.toNanos", "jdk.internal.event.ThreadSleepEvent.", + "jdk.internal.event.ThreadSleepEvent.", "jdk.internal.event.ThreadSleepEvent.isTurnedOn", "jdk.internal.event.ThreadSleepEvent.isEnabled" }; @@ -210,7 +211,7 @@ private static boolean checkTrace(StackTraceElement[] elements) { // recursionNative() methods must not be greater than depth, // also one run() and one waitForSign(), plus whatever can be // reached from Thread.yield or Thread.sleep. - int expectedLength = depth + 6; + int expectedLength = depth + 7; boolean result = true; // Check the length of the trace From febc34dd285c3382716e068748d4a3b0c73d87ad Mon Sep 17 00:00:00 2001 From: Xin Liu Date: Sat, 19 Aug 2023 17:42:30 +0000 Subject: [PATCH 118/162] 8314610: hotspot can't compile with the latest of gtest because of Reviewed-by: jiefu, stuefe --- .../gtest/gc/shared/test_memset_with_concurrent_readers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp b/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp index 7a3845e336a..875186b83d0 100644 --- a/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp +++ b/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/vmassert_uninstall.hpp" +#include #include #include #include "utilities/vmassert_reinstall.hpp" From ed0f75f2666f61ec3d8ccb78594a21db9f1be50a Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Sat, 19 Aug 2023 18:42:43 +0000 Subject: [PATCH 119/162] 8313290: Misleading exception message from STS.Subtask::get when task forked after shutdown Reviewed-by: psandoz --- .../util/concurrent/StructuredTaskScope.java | 13 ++++++------- .../StructuredTaskScopeTest.java | 18 ++---------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java b/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java index 5440f2e747f..f4e624c5852 100644 --- a/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java +++ b/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java @@ -576,8 +576,6 @@ public Subtask fork(Callable task) { } SubtaskImpl subtask = new SubtaskImpl<>(this, task, round); - boolean started = false; - if (s < SHUTDOWN) { // create thread to run task Thread thread = factory.newThread(subtask); @@ -588,15 +586,14 @@ public Subtask fork(Callable task) { // attempt to start the thread try { flock.start(thread); - started = true; } catch (IllegalStateException e) { // shutdown by another thread, or underlying flock is shutdown due // to unstructured use } } - // force owner to join if thread started - if (started && Thread.currentThread() == flock.owner() && round > forkRound) { + // force owner to join if this is the first fork in the round + if (Thread.currentThread() == flock.owner() && round > forkRound) { forkRound = round; } @@ -939,7 +936,8 @@ public T get() { T r = (T) result; return r; } - throw new IllegalStateException("Subtask not completed or did not complete successfully"); + throw new IllegalStateException( + "Result is unavailable or subtask did not complete successfully"); } @Override @@ -949,7 +947,8 @@ public Throwable exception() { if (result instanceof AltResult alt && alt.state() == State.FAILED) { return alt.exception(); } - throw new IllegalStateException("Subtask not completed or did not complete with exception"); + throw new IllegalStateException( + "Exception is unavailable or subtask did not complete with exception"); } @Override diff --git a/test/jdk/java/util/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java b/test/jdk/java/util/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java index 11e3f70b3ed..5ed7af8c46b 100644 --- a/test/jdk/java/util/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java +++ b/test/jdk/java/util/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java @@ -279,6 +279,7 @@ void testForkAfterShutdown(ThreadFactory factory) throws Exception { executed.set(true); return null; }); + scope.join(); assertEquals(Subtask.State.UNAVAILABLE, subtask.state()); assertThrows(IllegalStateException.class, subtask::get); assertThrows(IllegalStateException.class, subtask::exception); @@ -673,22 +674,6 @@ void testInterruptJoinUntil2(ThreadFactory factory) throws Exception { } } - /** - * Test that shutdown prevents new threads from starting. - */ - @Test - void testShutdownWithFork() throws Exception { - ThreadFactory factory = task -> null; - try (var scope = new StructuredTaskScope(null, factory)) { - scope.shutdown(); - // should not invoke the ThreadFactory to create thread - Subtask subtask = scope.fork(() -> null); - assertEquals(Subtask.State.UNAVAILABLE, subtask.state()); - assertThrows(IllegalStateException.class, subtask::get); - assertThrows(IllegalStateException.class, subtask::exception); - } - } - /** * Test that shutdown interrupts unfinished subtasks. */ @@ -1377,6 +1362,7 @@ void testSubtaskWhenShutdown(ThreadFactory factory) throws Exception { // fork after shutdown Subtask subtask = scope.fork(task); + scope.join(); assertEquals(task, subtask.task()); assertEquals(Subtask.State.UNAVAILABLE, subtask.state()); assertThrows(IllegalStateException.class, subtask::get); From c50315de8f13d316a7de08be53716cd88fa801c4 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Mon, 21 Aug 2023 06:30:56 +0000 Subject: [PATCH 120/162] 8314495: Update to use jtreg 7.3.1 Reviewed-by: dholmes, erikj, iris, jpai --- make/autoconf/lib-tests.m4 | 2 +- make/conf/github-actions.conf | 2 +- make/conf/jib-profiles.js | 4 ++-- test/hotspot/jtreg/TEST.ROOT | 2 +- test/jaxp/TEST.ROOT | 2 +- test/jdk/ProblemList.txt | 3 --- test/jdk/TEST.ROOT | 2 +- test/langtools/TEST.ROOT | 2 +- test/lib-test/TEST.ROOT | 2 +- 9 files changed, 9 insertions(+), 12 deletions(-) diff --git a/make/autoconf/lib-tests.m4 b/make/autoconf/lib-tests.m4 index e75103852c5..aecea86b744 100644 --- a/make/autoconf/lib-tests.m4 +++ b/make/autoconf/lib-tests.m4 @@ -28,7 +28,7 @@ ################################################################################ # Minimum supported versions -JTREG_MINIMUM_VERSION=7.3 +JTREG_MINIMUM_VERSION=7.3.1 GTEST_MINIMUM_VERSION=1.14.0 ############################################################################### diff --git a/make/conf/github-actions.conf b/make/conf/github-actions.conf index 60f1287eb4e..f10095daa6c 100644 --- a/make/conf/github-actions.conf +++ b/make/conf/github-actions.conf @@ -26,7 +26,7 @@ # Versions and download locations for dependencies used by GitHub Actions (GHA) GTEST_VERSION=1.14.0 -JTREG_VERSION=7.3+1 +JTREG_VERSION=7.3.1+1 LINUX_X64_BOOT_JDK_EXT=tar.gz LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_linux-x64_bin.tar.gz diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index fa3f2ead713..043b935f361 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -1188,9 +1188,9 @@ var getJibProfilesDependencies = function (input, common) { jtreg: { server: "jpg", product: "jtreg", - version: "7.3", + version: "7.3.1", build_number: "1", - file: "bundles/jtreg-7.3+1.zip", + file: "bundles/jtreg-7.3.1+1.zip", environment_name: "JT_HOME", environment_path: input.get("jtreg", "home_path") + "/bin", configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"), diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index 43a76558ea4..ba2e151f67e 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -88,7 +88,7 @@ requires.properties= \ jdk.containerized # Minimum jtreg version -requiredVersion=7.3+1 +requiredVersion=7.3.1+1 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../../ notation to reach them diff --git a/test/jaxp/TEST.ROOT b/test/jaxp/TEST.ROOT index f4f737b3da4..a44ad3a7c01 100644 --- a/test/jaxp/TEST.ROOT +++ b/test/jaxp/TEST.ROOT @@ -23,7 +23,7 @@ modules=java.xml groups=TEST.groups # Minimum jtreg version -requiredVersion=7.3+1 +requiredVersion=7.3.1+1 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index d0e7389094b..31546524178 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -765,9 +765,6 @@ jdk/jfr/api/consumer/recordingstream/TestOnEvent.java 8255404 linux-x6 ############################################################################ # Client manual tests -javax/swing/JFileChooser/FileSystemView/SystemIconTest.java 8313902 windows-all -sanity/client/SwingSet/src/FileChooserDemoTest.java 8313903 windows-all - javax/swing/JFileChooser/6698013/bug6698013.java 8024419 macosx-all javax/swing/JColorChooser/8065098/bug8065098.java 8065647 macosx-all javax/swing/JTabbedPane/4666224/bug4666224.html 8144124 macosx-all diff --git a/test/jdk/TEST.ROOT b/test/jdk/TEST.ROOT index a226571a79e..d0297c44697 100644 --- a/test/jdk/TEST.ROOT +++ b/test/jdk/TEST.ROOT @@ -80,7 +80,7 @@ requires.properties= \ jdk.foreign.linker # Minimum jtreg version -requiredVersion=7.3+1 +requiredVersion=7.3.1+1 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them diff --git a/test/langtools/TEST.ROOT b/test/langtools/TEST.ROOT index 9bc4288fa0e..da884dee170 100644 --- a/test/langtools/TEST.ROOT +++ b/test/langtools/TEST.ROOT @@ -15,7 +15,7 @@ keys=intermittent randomness needs-src needs-src-jdk_javadoc groups=TEST.groups # Minimum jtreg version -requiredVersion=7.3+1 +requiredVersion=7.3.1+1 # Use new module options useNewOptions=true diff --git a/test/lib-test/TEST.ROOT b/test/lib-test/TEST.ROOT index 84d11755f6c..9b91a0dfcc1 100644 --- a/test/lib-test/TEST.ROOT +++ b/test/lib-test/TEST.ROOT @@ -29,7 +29,7 @@ keys=randomness # Minimum jtreg version -requiredVersion=7.3+1 +requiredVersion=7.3.1+1 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them From ec1f7a8480db025a6f405817a106af8e92b69c44 Mon Sep 17 00:00:00 2001 From: Sidraya Date: Mon, 21 Aug 2023 07:15:25 +0000 Subject: [PATCH 121/162] 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) Reviewed-by: amitkumar, jvernee, mdoerr --- src/hotspot/cpu/s390/downcallLinker_s390.cpp | 265 ++++++++++++++- src/hotspot/cpu/s390/foreignGlobals_s390.cpp | 197 ++++++++++- src/hotspot/cpu/s390/foreignGlobals_s390.hpp | 19 +- src/hotspot/cpu/s390/frame_s390.cpp | 27 +- src/hotspot/cpu/s390/frame_s390.inline.hpp | 10 +- .../cpu/s390/globalDefinitions_s390.hpp | 2 +- src/hotspot/cpu/s390/methodHandles_s390.cpp | 11 +- src/hotspot/cpu/s390/upcallLinker_s390.cpp | 278 +++++++++++++++- src/hotspot/cpu/s390/vmstorage_s390.hpp | 67 +++- .../classes/jdk/internal/foreign/CABI.java | 7 +- .../internal/foreign/abi/AbstractLinker.java | 4 +- .../jdk/internal/foreign/abi/SharedUtils.java | 2 + .../foreign/abi/s390/S390Architecture.java | 151 +++++++++ .../abi/s390/linux/LinuxS390CallArranger.java | 311 ++++++++++++++++++ .../abi/s390/linux/LinuxS390Linker.java | 64 ++++ .../foreign/abi/s390/linux/TypeClass.java | 126 +++++++ .../foreign/TestClassLoaderFindNative.java | 7 +- test/jdk/java/foreign/TestIllegalLink.java | 24 +- .../platform/PlatformLayouts.java | 1 - 19 files changed, 1519 insertions(+), 54 deletions(-) create mode 100644 src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java create mode 100644 src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java create mode 100644 src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java create mode 100644 src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java diff --git a/src/hotspot/cpu/s390/downcallLinker_s390.cpp b/src/hotspot/cpu/s390/downcallLinker_s390.cpp index baee7d7a043..f831da90755 100644 --- a/src/hotspot/cpu/s390/downcallLinker_s390.cpp +++ b/src/hotspot/cpu/s390/downcallLinker_s390.cpp @@ -23,8 +23,76 @@ */ #include "precompiled.hpp" +#include "asm/macroAssembler.inline.hpp" +#include "code/codeBlob.hpp" +#include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" +#include "compiler/oopMap.hpp" +#include "logging/logStream.hpp" +#include "memory/resourceArea.hpp" #include "prims/downcallLinker.hpp" -#include "utilities/debug.hpp" +#include "runtime/globals.hpp" +#include "runtime/stubCodeGenerator.hpp" + +#define __ _masm-> + +class DowncallStubGenerator : public StubCodeGenerator { + BasicType* _signature; + int _num_args; + BasicType _ret_bt; + const ABIDescriptor& _abi; + + const GrowableArray& _input_registers; + const GrowableArray& _output_registers; + + bool _needs_return_buffer; + int _captured_state_mask; + bool _needs_transition; + + int _frame_complete; + int _frame_size_slots; + OopMapSet* _oop_maps; + public: + DowncallStubGenerator(CodeBuffer* buffer, + BasicType* signature, + int num_args, + BasicType ret_bt, + const ABIDescriptor& abi, + const GrowableArray& input_registers, + const GrowableArray& output_registers, + bool needs_return_buffer, + int captured_state_mask, + bool needs_transition) + :StubCodeGenerator(buffer, PrintMethodHandleStubs), + _signature(signature), + _num_args(num_args), + _ret_bt(ret_bt), + _abi(abi), + _input_registers(input_registers), + _output_registers(output_registers), + _needs_return_buffer(needs_return_buffer), + _captured_state_mask(captured_state_mask), + _needs_transition(needs_transition), + _frame_complete(0), + _frame_size_slots(0), + _oop_maps(nullptr) { + } + void generate(); + int frame_complete() const { + return _frame_complete; + } + + int framesize() const { + return (_frame_size_slots >> (LogBytesPerWord - LogBytesPerInt)); + } + + OopMapSet* oop_maps() const { + return _oop_maps; + } +}; + +static const int native_invoker_code_base_size = 512; +static const int native_invoker_size_per_args = 8; RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature, int num_args, @@ -35,6 +103,197 @@ RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature, bool needs_return_buffer, int captured_state_mask, bool needs_transition) { - Unimplemented(); - return nullptr; + + int code_size = native_invoker_code_base_size + (num_args * native_invoker_size_per_args); + int locs_size = 1; //must be non zero + CodeBuffer code("nep_invoker_blob", code_size, locs_size); + + DowncallStubGenerator g(&code, signature, num_args, ret_bt, abi, + input_registers, output_registers, + needs_return_buffer, captured_state_mask, + needs_transition); + g.generate(); + code.log_section_sizes("nep_invoker_blob"); + + RuntimeStub* stub = + RuntimeStub::new_runtime_stub("nep_invoker_blob", + &code, + g.frame_complete(), + g.framesize(), + g.oop_maps(), false); + +#ifndef PRODUCT + LogTarget(Trace, foreign, downcall) lt; + if (lt.is_enabled()) { + ResourceMark rm; + LogStream ls(lt); + stub->print_on(&ls); + } +#endif + + return stub; +} + +void DowncallStubGenerator::generate() { + Register call_target_address = Z_R1_scratch, + tmp = Z_R0_scratch; + + VMStorage shuffle_reg = _abi._scratch1; + + JavaCallingConvention in_conv; + NativeCallingConvention out_conv(_input_registers); + ArgumentShuffle arg_shuffle(_signature, _num_args, _signature, _num_args, &in_conv, &out_conv, shuffle_reg); + +#ifndef PRODUCT + LogTarget(Trace, foreign, downcall) lt; + if (lt.is_enabled()) { + ResourceMark rm; + LogStream ls(lt); + arg_shuffle.print_on(&ls); + } +#endif + + assert(_abi._shadow_space_bytes == frame::z_abi_160_size, "expected space according to ABI"); + int allocated_frame_size = _abi._shadow_space_bytes; + allocated_frame_size += arg_shuffle.out_arg_bytes(); + + assert(!_needs_return_buffer, "unexpected needs_return_buffer"); + RegSpiller out_reg_spiller(_output_registers); + int spill_offset = allocated_frame_size; + allocated_frame_size += BytesPerWord; + + StubLocations locs; + locs.set(StubLocations::TARGET_ADDRESS, _abi._scratch2); + + if (_captured_state_mask != 0) { + __ block_comment("{ _captured_state_mask is set"); + locs.set_frame_data(StubLocations::CAPTURED_STATE_BUFFER, allocated_frame_size); + allocated_frame_size += BytesPerWord; + __ block_comment("} _captured_state_mask is set"); + } + + allocated_frame_size = align_up(allocated_frame_size, StackAlignmentInBytes); + _frame_size_slots = allocated_frame_size >> LogBytesPerInt; + + _oop_maps = _needs_transition ? new OopMapSet() : nullptr; + address start = __ pc(); + + __ save_return_pc(); + __ push_frame(allocated_frame_size, Z_R11); // Create a new frame for the wrapper. + + _frame_complete = __ pc() - start; // frame build complete. + + if (_needs_transition) { + __ block_comment("{ thread java2native"); + __ get_PC(Z_R1_scratch); + address the_pc = __ pc(); + __ set_last_Java_frame(Z_SP, Z_R1_scratch); + + OopMap* map = new OopMap(_frame_size_slots, 0); + _oop_maps->add_gc_map(the_pc - start, map); + + // State transition + __ set_thread_state(_thread_in_native); + __ block_comment("} thread java2native"); + } + __ block_comment("{ argument shuffle"); + arg_shuffle.generate(_masm, shuffle_reg, frame::z_jit_out_preserve_size, _abi._shadow_space_bytes, locs); + __ block_comment("} argument shuffle"); + + __ call(as_Register(locs.get(StubLocations::TARGET_ADDRESS))); + + ////////////////////////////////////////////////////////////////////////////// + + if (_captured_state_mask != 0) { + __ block_comment("{ save thread local"); + + out_reg_spiller.generate_spill(_masm, spill_offset); + + __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, DowncallLinker::capture_state)); + __ z_lg(Z_ARG1, Address(Z_SP, locs.data_offset(StubLocations::CAPTURED_STATE_BUFFER))); + __ load_const_optimized(Z_ARG2, _captured_state_mask); + __ call(call_target_address); + + out_reg_spiller.generate_fill(_masm, spill_offset); + + __ block_comment("} save thread local"); + } + + ////////////////////////////////////////////////////////////////////////////// + + Label L_after_safepoint_poll; + Label L_safepoint_poll_slow_path; + Label L_reguard; + Label L_after_reguard; + + if (_needs_transition) { + __ block_comment("{ thread native2java"); + __ set_thread_state(_thread_in_native_trans); + + if (!UseSystemMemoryBarrier) { + __ z_fence(); // Order state change wrt. safepoint poll. + } + + __ safepoint_poll(L_safepoint_poll_slow_path, tmp); + + __ load_and_test_int(tmp, Address(Z_thread, JavaThread::suspend_flags_offset())); + __ z_brne(L_safepoint_poll_slow_path); + + __ bind(L_after_safepoint_poll); + + // change thread state + __ set_thread_state(_thread_in_Java); + + __ block_comment("reguard stack check"); + __ z_cli(Address(Z_thread, JavaThread::stack_guard_state_offset() + in_ByteSize(sizeof(StackOverflow::StackGuardState) - 1)), + StackOverflow::stack_guard_yellow_reserved_disabled); + __ z_bre(L_reguard); + __ bind(L_after_reguard); + + __ reset_last_Java_frame(); + __ block_comment("} thread native2java"); + } + + __ pop_frame(); + __ restore_return_pc(); // This is the way back to the caller. + __ z_br(Z_R14); + + ////////////////////////////////////////////////////////////////////////////// + + if (_needs_transition) { + __ block_comment("{ L_safepoint_poll_slow_path"); + __ bind(L_safepoint_poll_slow_path); + + // Need to save the native result registers around any runtime calls. + out_reg_spiller.generate_spill(_masm, spill_offset); + + __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, JavaThread::check_special_condition_for_native_trans)); + __ z_lgr(Z_ARG1, Z_thread); + __ call(call_target_address); + + out_reg_spiller.generate_fill(_masm, spill_offset); + + __ z_bru(L_after_safepoint_poll); + __ block_comment("} L_safepoint_poll_slow_path"); + + ////////////////////////////////////////////////////////////////////////////// + __ block_comment("{ L_reguard"); + __ bind(L_reguard); + + // Need to save the native result registers around any runtime calls. + out_reg_spiller.generate_spill(_masm, spill_offset); + + __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, SharedRuntime::reguard_yellow_pages)); + __ call(call_target_address); + + out_reg_spiller.generate_fill(_masm, spill_offset); + + __ z_bru(L_after_reguard); + + __ block_comment("} L_reguard"); + } + + ////////////////////////////////////////////////////////////////////////////// + + __ flush(); } diff --git a/src/hotspot/cpu/s390/foreignGlobals_s390.cpp b/src/hotspot/cpu/s390/foreignGlobals_s390.cpp index d3a318536bd..9796ab4ffe4 100644 --- a/src/hotspot/cpu/s390/foreignGlobals_s390.cpp +++ b/src/hotspot/cpu/s390/foreignGlobals_s390.cpp @@ -23,34 +23,209 @@ */ #include "precompiled.hpp" -#include "code/vmreg.hpp" +#include "asm/macroAssembler.inline.hpp" +#include "code/vmreg.inline.hpp" +#include "runtime/jniHandles.hpp" +#include "runtime/jniHandles.inline.hpp" +#include "oops/typeArrayOop.inline.hpp" +#include "oops/oopCast.inline.hpp" #include "prims/foreignGlobals.hpp" -#include "utilities/debug.hpp" +#include "prims/foreignGlobals.inline.hpp" +#include "prims/vmstorage.hpp" +#include "utilities/formatBuffer.hpp" -class MacroAssembler; +#define __ masm-> + +bool ABIDescriptor::is_volatile_reg(Register reg) const { + return _integer_volatile_registers.contains(reg); +} + +bool ABIDescriptor::is_volatile_reg(FloatRegister reg) const { + return _float_argument_registers.contains(reg) + || _float_additional_volatile_registers.contains(reg); +} bool ForeignGlobals::is_foreign_linker_supported() { - return false; + return true; } const ABIDescriptor ForeignGlobals::parse_abi_descriptor(jobject jabi) { - Unimplemented(); - return {}; + oop abi_oop = JNIHandles::resolve_non_null(jabi); + ABIDescriptor abi; + + objArrayOop inputStorage = jdk_internal_foreign_abi_ABIDescriptor::inputStorage(abi_oop); + parse_register_array(inputStorage, StorageType::INTEGER, abi._integer_argument_registers, as_Register); + parse_register_array(inputStorage, StorageType::FLOAT, abi._float_argument_registers, as_FloatRegister); + + objArrayOop outputStorage = jdk_internal_foreign_abi_ABIDescriptor::outputStorage(abi_oop); + parse_register_array(outputStorage, StorageType::INTEGER, abi._integer_return_registers, as_Register); + parse_register_array(outputStorage, StorageType::FLOAT, abi._float_return_registers, as_FloatRegister); + + objArrayOop volatileStorage = jdk_internal_foreign_abi_ABIDescriptor::volatileStorage(abi_oop); + parse_register_array(volatileStorage, StorageType::INTEGER, abi._integer_volatile_registers, as_Register); + parse_register_array(volatileStorage, StorageType::FLOAT, abi._float_additional_volatile_registers, as_FloatRegister); + + abi._stack_alignment_bytes = jdk_internal_foreign_abi_ABIDescriptor::stackAlignment(abi_oop); + abi._shadow_space_bytes = jdk_internal_foreign_abi_ABIDescriptor::shadowSpace(abi_oop); + + abi._scratch1 = parse_vmstorage(jdk_internal_foreign_abi_ABIDescriptor::scratch1(abi_oop)); + abi._scratch2 = parse_vmstorage(jdk_internal_foreign_abi_ABIDescriptor::scratch2(abi_oop)); + + return abi; } int RegSpiller::pd_reg_size(VMStorage reg) { - Unimplemented(); - return -1; + if (reg.type() == StorageType::INTEGER || reg.type() == StorageType::FLOAT) { + return 8; + } + return 0; // stack and BAD } void RegSpiller::pd_store_reg(MacroAssembler* masm, int offset, VMStorage reg) { - Unimplemented(); + if (reg.type() == StorageType::INTEGER) { + __ reg2mem_opt(as_Register(reg), Address(Z_SP, offset), true); + } else if (reg.type() == StorageType::FLOAT) { + __ freg2mem_opt(as_FloatRegister(reg), Address(Z_SP, offset), true); + } else { + // stack and BAD + } } void RegSpiller::pd_load_reg(MacroAssembler* masm, int offset, VMStorage reg) { - Unimplemented(); + if (reg.type() == StorageType::INTEGER) { + __ mem2reg_opt(as_Register(reg), Address(Z_SP, offset), true); + } else if (reg.type() == StorageType::FLOAT) { + __ mem2freg_opt(as_FloatRegister(reg), Address(Z_SP, offset), true); + } else { + // stack and BAD + } +} + +static int reg2offset(VMStorage vms, int stk_bias) { + assert(!vms.is_reg(), "wrong usage"); + return vms.index_or_offset() + stk_bias; +} + +static void move_reg(MacroAssembler* masm, int out_stk_bias, + VMStorage from_reg, VMStorage to_reg) { + int out_bias = 0; + switch (to_reg.type()) { + case StorageType::INTEGER: + if (to_reg.segment_mask() == REG64_MASK && from_reg.segment_mask() == REG32_MASK ) { + // see CCallingConventionRequiresIntsAsLongs + __ z_lgfr(as_Register(to_reg), as_Register(from_reg)); + } else { + __ lgr_if_needed(as_Register(to_reg), as_Register(from_reg)); + } + break; + case StorageType::STACK: + out_bias = out_stk_bias; //fallthrough + case StorageType::FRAME_DATA: { + // Integer types always get a 64 bit slot in C. + if (from_reg.segment_mask() == REG32_MASK) { + // see CCallingConventionRequiresIntsAsLongs + __ z_lgfr(as_Register(from_reg), as_Register(from_reg)); + } + switch (to_reg.stack_size()) { + case 8: __ reg2mem_opt(as_Register(from_reg), Address(Z_SP, reg2offset(to_reg, out_bias)), true); break; + case 4: __ reg2mem_opt(as_Register(from_reg), Address(Z_SP, reg2offset(to_reg, out_bias)), false); break; + default: ShouldNotReachHere(); + } + } break; + default: ShouldNotReachHere(); + } +} + +static void move_float(MacroAssembler* masm, int out_stk_bias, + VMStorage from_reg, VMStorage to_reg) { + switch (to_reg.type()) { + case StorageType::FLOAT: + if (from_reg.segment_mask() == REG64_MASK) + __ move_freg_if_needed(as_FloatRegister(to_reg), T_DOUBLE, as_FloatRegister(from_reg), T_DOUBLE); + else + __ move_freg_if_needed(as_FloatRegister(to_reg), T_FLOAT, as_FloatRegister(from_reg), T_FLOAT); + break; + case StorageType::STACK: + if (from_reg.segment_mask() == REG64_MASK) { + assert(to_reg.stack_size() == 8, "size should match"); + __ freg2mem_opt(as_FloatRegister(from_reg), Address(Z_SP, reg2offset(to_reg, out_stk_bias)), true); + } else { + assert(to_reg.stack_size() == 4, "size should match"); + __ freg2mem_opt(as_FloatRegister(from_reg), Address(Z_SP, reg2offset(to_reg, out_stk_bias)), false); + } + break; + default: ShouldNotReachHere(); + } +} + +static void move_stack(MacroAssembler* masm, Register tmp_reg, int in_stk_bias, int out_stk_bias, + VMStorage from_reg, VMStorage to_reg) { + int out_bias = 0; + Address from_addr(Z_R11, reg2offset(from_reg, in_stk_bias)); + switch (to_reg.type()) { + case StorageType::INTEGER: + switch (from_reg.stack_size()) { + case 8: __ mem2reg_opt(as_Register(to_reg), from_addr, true);break; + case 4: __ mem2reg_opt(as_Register(to_reg), from_addr, false);break; + default: ShouldNotReachHere(); + } + break; + case StorageType::FLOAT: + switch (from_reg.stack_size()) { + case 8: __ mem2freg_opt(as_FloatRegister(to_reg), from_addr, true);break; + case 4: __ mem2freg_opt(as_FloatRegister(to_reg), from_addr, false);break; + default: ShouldNotReachHere(); + } + break; + case StorageType::STACK: + out_bias = out_stk_bias; // fallthrough + case StorageType::FRAME_DATA: { + switch (from_reg.stack_size()) { + case 8: __ mem2reg_opt(tmp_reg, from_addr, true); break; + case 4: if (to_reg.stack_size() == 8) { + __ mem2reg_signed_opt(tmp_reg, from_addr); + } else { + __ mem2reg_opt(tmp_reg, from_addr, false); + } + break; + default: ShouldNotReachHere(); + } + switch (to_reg.stack_size()) { + case 8: __ reg2mem_opt(tmp_reg, Address (Z_SP, reg2offset(to_reg, out_bias)), true); break; + case 4: __ reg2mem_opt(tmp_reg, Address (Z_SP, reg2offset(to_reg, out_bias)), false); break; + default: ShouldNotReachHere(); + } + } break; + default: ShouldNotReachHere(); + } } void ArgumentShuffle::pd_generate(MacroAssembler* masm, VMStorage tmp, int in_stk_bias, int out_stk_bias, const StubLocations& locs) const { - Unimplemented(); + Register tmp_reg = as_Register(tmp); + for (int i = 0; i < _moves.length(); i++) { + Move move = _moves.at(i); + VMStorage from_reg = move.from; + VMStorage to_reg = move.to; + + // replace any placeholders + if (from_reg.type() == StorageType::PLACEHOLDER) { + from_reg = locs.get(from_reg); + } + if (to_reg.type() == StorageType::PLACEHOLDER) { + to_reg = locs.get(to_reg); + } + + switch (from_reg.type()) { + case StorageType::INTEGER: + move_reg(masm, out_stk_bias, from_reg, to_reg); + break; + case StorageType::FLOAT: + move_float(masm, out_stk_bias, from_reg, to_reg); + break; + case StorageType::STACK: + move_stack(masm, tmp_reg, in_stk_bias, out_stk_bias, from_reg, to_reg); + break; + default: ShouldNotReachHere(); + } + } } diff --git a/src/hotspot/cpu/s390/foreignGlobals_s390.hpp b/src/hotspot/cpu/s390/foreignGlobals_s390.hpp index 8b86a2b06a6..4ff3b3e40b4 100644 --- a/src/hotspot/cpu/s390/foreignGlobals_s390.hpp +++ b/src/hotspot/cpu/s390/foreignGlobals_s390.hpp @@ -24,6 +24,23 @@ #ifndef CPU_S390_VM_FOREIGN_GLOBALS_S390_HPP #define CPU_S390_VM_FOREIGN_GLOBALS_S390_HPP -class ABIDescriptor {}; +struct ABIDescriptor { + GrowableArray _integer_argument_registers; + GrowableArray _integer_return_registers; + GrowableArray _float_argument_registers; + GrowableArray _float_return_registers; + + GrowableArray _integer_volatile_registers; + GrowableArray _float_additional_volatile_registers; + + int32_t _stack_alignment_bytes; + int32_t _shadow_space_bytes; + + VMStorage _scratch1; + VMStorage _scratch2; + + bool is_volatile_reg(Register reg) const; + bool is_volatile_reg(FloatRegister reg) const; +}; #endif // CPU_S390_VM_FOREIGN_GLOBALS_S390_HPP diff --git a/src/hotspot/cpu/s390/frame_s390.cpp b/src/hotspot/cpu/s390/frame_s390.cpp index 23547fa6617..ac24e43f00c 100644 --- a/src/hotspot/cpu/s390/frame_s390.cpp +++ b/src/hotspot/cpu/s390/frame_s390.cpp @@ -218,13 +218,32 @@ frame frame::sender_for_entry_frame(RegisterMap *map) const { } UpcallStub::FrameData* UpcallStub::frame_data_for_frame(const frame& frame) const { - ShouldNotCallThis(); - return nullptr; + assert(frame.is_upcall_stub_frame(), "wrong frame"); + // need unextended_sp here, since normal sp is wrong for interpreter callees + return reinterpret_cast( + reinterpret_cast
    (frame.unextended_sp()) + in_bytes(_frame_data_offset)); } bool frame::upcall_stub_frame_is_first() const { - ShouldNotCallThis(); - return false; + assert(is_upcall_stub_frame(), "must be optimized entry frame"); + UpcallStub* blob = _cb->as_upcall_stub(); + JavaFrameAnchor* jfa = blob->jfa_for_frame(*this); + return jfa->last_Java_sp() == nullptr; +} + +frame frame::sender_for_upcall_stub_frame(RegisterMap* map) const { + assert(map != nullptr, "map must be set"); + UpcallStub* blob = _cb->as_upcall_stub(); + // Java frame called from C; skip all C frames and return top C + // frame of that chunk as the sender + JavaFrameAnchor* jfa = blob->jfa_for_frame(*this); + assert(!upcall_stub_frame_is_first(), "must have a frame anchor to go back to"); + assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack"); + map->clear(); + assert(map->include_argument_oops(), "should be set by clear"); + frame fr(jfa->last_Java_sp(), jfa->last_Java_pc()); + + return fr; } frame frame::sender_for_interpreter_frame(RegisterMap *map) const { diff --git a/src/hotspot/cpu/s390/frame_s390.inline.hpp b/src/hotspot/cpu/s390/frame_s390.inline.hpp index 271305e37d1..33cdf7d7432 100644 --- a/src/hotspot/cpu/s390/frame_s390.inline.hpp +++ b/src/hotspot/cpu/s390/frame_s390.inline.hpp @@ -350,12 +350,10 @@ inline frame frame::sender(RegisterMap* map) const { // update it accordingly. map->set_include_argument_oops(false); - if (is_entry_frame()) { - return sender_for_entry_frame(map); - } - if (is_interpreted_frame()) { - return sender_for_interpreter_frame(map); - } + if (is_entry_frame()) return sender_for_entry_frame(map); + if (is_upcall_stub_frame()) return sender_for_upcall_stub_frame(map); + if (is_interpreted_frame()) return sender_for_interpreter_frame(map); + assert(_cb == CodeCache::find_blob(pc()),"Must be the same"); if (_cb != nullptr) return sender_for_compiled_frame(map); diff --git a/src/hotspot/cpu/s390/globalDefinitions_s390.hpp b/src/hotspot/cpu/s390/globalDefinitions_s390.hpp index 32a6ff39fb4..39baf5bf047 100644 --- a/src/hotspot/cpu/s390/globalDefinitions_s390.hpp +++ b/src/hotspot/cpu/s390/globalDefinitions_s390.hpp @@ -28,7 +28,7 @@ #define ShortenBranches true -const int StackAlignmentInBytes = 16; +const int StackAlignmentInBytes = 8; // All faults on s390x give the address only on page granularity. // Set Pdsegfault_address to minimum one page address. diff --git a/src/hotspot/cpu/s390/methodHandles_s390.cpp b/src/hotspot/cpu/s390/methodHandles_s390.cpp index 6392ba45a6c..ef8722f2499 100644 --- a/src/hotspot/cpu/s390/methodHandles_s390.cpp +++ b/src/hotspot/cpu/s390/methodHandles_s390.cpp @@ -349,7 +349,16 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* void MethodHandles::jump_to_native_invoker(MacroAssembler* _masm, Register nep_reg, Register temp_target) { BLOCK_COMMENT("jump_to_native_invoker {"); - __ should_not_reach_here(); + assert(nep_reg != noreg, "required register"); + + // Load the invoker, as NEP -> .invoker + __ verify_oop(nep_reg); + + __ z_lg(temp_target, Address(nep_reg, + NONZERO(jdk_internal_foreign_abi_NativeEntryPoint::downcall_stub_address_offset_in_bytes()))); + + __ z_br(temp_target); + BLOCK_COMMENT("} jump_to_native_invoker"); } diff --git a/src/hotspot/cpu/s390/upcallLinker_s390.cpp b/src/hotspot/cpu/s390/upcallLinker_s390.cpp index 3e1fb04218b..b748ec547cc 100644 --- a/src/hotspot/cpu/s390/upcallLinker_s390.cpp +++ b/src/hotspot/cpu/s390/upcallLinker_s390.cpp @@ -22,15 +22,287 @@ */ #include "precompiled.hpp" +#include "asm/macroAssembler.inline.hpp" +#include "logging/logStream.hpp" +#include "memory/resourceArea.hpp" #include "prims/upcallLinker.hpp" -#include "utilities/debug.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/signature.hpp" +#include "runtime/stubRoutines.hpp" +#include "utilities/formatBuffer.hpp" +#include "utilities/globalDefinitions.hpp" +#define __ _masm-> + +// for callee saved regs, according to the caller's ABI +static int compute_reg_save_area_size(const ABIDescriptor& abi) { + int size = 0; + for (int i = 0; i < Register::number_of_registers; i++) { + Register reg = as_Register(i); + // Z_SP saved/restored by prologue/epilogue + if (reg == Z_SP) continue; + if (!abi.is_volatile_reg(reg)) { + size += 8; // bytes + } + } + + for (int i = 0; i < FloatRegister::number_of_registers; i++) { + FloatRegister reg = as_FloatRegister(i); + if (!abi.is_volatile_reg(reg)) { + size += 8; // bytes + } + } + + return size; +} + +static void preserve_callee_saved_registers(MacroAssembler* _masm, const ABIDescriptor& abi, int reg_save_area_offset) { + // 1. iterate all registers in the architecture + // - check if they are volatile or not for the given abi + // - if NOT, we need to save it here + + int offset = reg_save_area_offset; + + __ block_comment("{ preserve_callee_saved_regs "); + for (int i = 0; i < Register::number_of_registers; i++) { + Register reg = as_Register(i); + // Z_SP saved/restored by prologue/epilogue + if (reg == Z_SP) continue; + if (!abi.is_volatile_reg(reg)) { + __ z_stg(reg, Address(Z_SP, offset)); + offset += 8; + } + } + + for (int i = 0; i < FloatRegister::number_of_registers; i++) { + FloatRegister reg = as_FloatRegister(i); + if (!abi.is_volatile_reg(reg)) { + __ z_std(reg, Address(Z_SP, offset)); + offset += 8; + } + } + + __ block_comment("} preserve_callee_saved_regs "); +} + +static void restore_callee_saved_registers(MacroAssembler* _masm, const ABIDescriptor& abi, int reg_save_area_offset) { + // 1. iterate all registers in the architecture + // - check if they are volatile or not for the given abi + // - if NOT, we need to restore it here + + int offset = reg_save_area_offset; + + __ block_comment("{ restore_callee_saved_regs "); + for (int i = 0; i < Register::number_of_registers; i++) { + Register reg = as_Register(i); + // Z_SP saved/restored by prologue/epilogue + if (reg == Z_SP) continue; + if (!abi.is_volatile_reg(reg)) { + __ z_lg(reg, Address(Z_SP, offset)); + offset += 8; + } + } + + for (int i = 0; i < FloatRegister::number_of_registers; i++) { + FloatRegister reg = as_FloatRegister(i); + if (!abi.is_volatile_reg(reg)) { + __ z_ld(reg, Address(Z_SP, offset)); + offset += 8; + } + } + + __ block_comment("} restore_callee_saved_regs "); +} + +static const int upcall_stub_code_base_size = 1024; // depends on GC (resolve_jobject) +static const int upcall_stub_size_per_arg = 16; // arg save & restore + move address UpcallLinker::make_upcall_stub(jobject receiver, Method* entry, BasicType* in_sig_bt, int total_in_args, BasicType* out_sig_bt, int total_out_args, BasicType ret_type, jobject jabi, jobject jconv, bool needs_return_buffer, int ret_buf_size) { - ShouldNotCallThis(); - return nullptr; + ResourceMark rm; + const ABIDescriptor abi = ForeignGlobals::parse_abi_descriptor(jabi); + const CallRegs call_regs = ForeignGlobals::parse_call_regs(jconv); + int code_size = upcall_stub_code_base_size + (total_in_args * upcall_stub_size_per_arg); + CodeBuffer buffer("upcall_stub", code_size, /* locs_size = */ 0); + + Register call_target_address = Z_R1_scratch; + + VMStorage shuffle_reg = abi._scratch1; + JavaCallingConvention out_conv; + NativeCallingConvention in_conv(call_regs._arg_regs); + ArgumentShuffle arg_shuffle(in_sig_bt, total_in_args, out_sig_bt, total_out_args, &in_conv, &out_conv, shuffle_reg); + + // The Java call uses the JIT ABI, but we also call C. + int out_arg_area = MAX2(frame::z_jit_out_preserve_size + arg_shuffle.out_arg_bytes(), (int)frame::z_abi_160_size); + +#ifndef PRODUCT + LogTarget(Trace, foreign, upcall) lt; + if (lt.is_enabled()) { + ResourceMark rm; + LogStream ls(lt); + arg_shuffle.print_on(&ls); + } +#endif + + + int reg_save_area_size = compute_reg_save_area_size(abi); + RegSpiller arg_spiller(call_regs._arg_regs); + RegSpiller result_spiller(call_regs._ret_regs); + + int res_save_area_offset = out_arg_area; + int arg_save_area_offset = res_save_area_offset + result_spiller.spill_size_bytes(); + int reg_save_area_offset = arg_save_area_offset + arg_spiller.spill_size_bytes(); + int frame_data_offset = reg_save_area_offset + reg_save_area_size; + int frame_bottom_offset = frame_data_offset + sizeof(UpcallStub::FrameData); + + int frame_size = align_up(frame_bottom_offset, StackAlignmentInBytes); + StubLocations locs; + + // The space we have allocated will look like: + // + // + // FP-> | | + // |---------------------| = frame_bottom_offset = frame_size + // | | + // | FrameData | + // |---------------------| = frame_data_offset + // | | + // | reg_save_area | + // |---------------------| = reg_save_are_offset + // | | + // | arg_save_area | + // |---------------------| = arg_save_are_offset + // | | + // | res_save_area | + // |---------------------| = res_save_are_offset + // | | + // SP-> | out_arg_area | needs to be at end for shadow space + // + // + + ////////////////////////////////////////////////////////////////////////////// + + MacroAssembler* _masm = new MacroAssembler(&buffer); + address start = __ pc(); + + __ save_return_pc(); + assert((abi._stack_alignment_bytes % StackAlignmentInBytes) == 0, "must be 8 byte aligned"); + // allocate frame (frame_size is also aligned, so stack is still aligned) + __ push_frame(frame_size); + + // we have to always spill args since we need to do a call to get the thread + // (and maybe attach it). + arg_spiller.generate_spill(_masm, arg_save_area_offset); + // Java methods won't preserve them, so save them here: + preserve_callee_saved_registers(_masm, abi, reg_save_area_offset); + + __ block_comment("{ on_entry"); + __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_entry)); + __ z_aghik(Z_ARG1, Z_SP, frame_data_offset); + __ call(call_target_address); + __ z_lgr(Z_thread, Z_RET); + __ block_comment("} on_entry"); + + arg_spiller.generate_fill(_masm, arg_save_area_offset); + __ block_comment("{ argument shuffle"); + arg_shuffle.generate(_masm, shuffle_reg, abi._shadow_space_bytes, frame::z_jit_out_preserve_size, locs); + __ block_comment("} argument shuffle"); + + __ block_comment("{ receiver "); + __ load_const_optimized(Z_ARG1, (intptr_t)receiver); + __ resolve_jobject(Z_ARG1, Z_tmp_1, Z_tmp_2); + __ block_comment("} receiver "); + + __ load_const_optimized(Z_method, (intptr_t)entry); + __ z_stg(Z_method, Address(Z_thread, in_bytes(JavaThread::callee_target_offset()))); + + __ z_lg(call_target_address, Address(Z_method, in_bytes(Method::from_compiled_offset()))); + __ call(call_target_address); + + // return value shuffle + assert(!needs_return_buffer, "unexpected needs_return_buffer"); + // CallArranger can pick a return type that goes in the same reg for both CCs. + if (call_regs._ret_regs.length() > 0) { // 0 or 1 + VMStorage ret_reg = call_regs._ret_regs.at(0); + // Check if the return reg is as expected. + switch (ret_type) { + case T_BOOLEAN: + case T_BYTE: + case T_SHORT: + case T_CHAR: + case T_INT: + __ z_lgfr(Z_RET, Z_RET); // Clear garbage in high half. + // fallthrough + case T_LONG: + assert(as_Register(ret_reg) == Z_RET, "unexpected result register"); + break; + case T_FLOAT: + case T_DOUBLE: + assert(as_FloatRegister(ret_reg) == Z_FRET, "unexpected result register"); + break; + default: + fatal("unexpected return type: %s", type2name(ret_type)); + } + } + + result_spiller.generate_spill(_masm, res_save_area_offset); + + __ block_comment("{ on_exit"); + __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::on_exit)); + __ z_aghik(Z_ARG1, Z_SP, frame_data_offset); + __ call(call_target_address); + __ block_comment("} on_exit"); + + restore_callee_saved_registers(_masm, abi, reg_save_area_offset); + + result_spiller.generate_fill(_masm, res_save_area_offset); + + __ pop_frame(); + __ restore_return_pc(); + __ z_br(Z_R14); + + ////////////////////////////////////////////////////////////////////////////// + + __ block_comment("{ exception handler"); + + intptr_t exception_handler_offset = __ pc() - start; + + // Native caller has no idea how to handle exceptions, + // so we just crash here. Up to callee to catch exceptions. + __ verify_oop(Z_ARG1); + __ load_const_optimized(call_target_address, CAST_FROM_FN_PTR(uint64_t, UpcallLinker::handle_uncaught_exception)); + __ call_c(call_target_address); + __ should_not_reach_here(); + + __ block_comment("} exception handler"); + + _masm->flush(); + +#ifndef PRODUCT + stringStream ss; + ss.print("upcall_stub_%s", entry->signature()->as_C_string()); + const char* name = _masm->code_string(ss.as_string()); +#else // PRODUCT + const char* name = "upcall_stub"; +#endif // PRODUCT + + buffer.log_section_sizes(name); + UpcallStub* blob + = UpcallStub::create(name, + &buffer, + exception_handler_offset, + receiver, + in_ByteSize(frame_data_offset)); +#ifndef PRODUCT + if (lt.is_enabled()) { + ResourceMark rm; + LogStream ls(lt); + blob->print_on(&ls); + } +#endif + + return blob->code_begin(); } diff --git a/src/hotspot/cpu/s390/vmstorage_s390.hpp b/src/hotspot/cpu/s390/vmstorage_s390.hpp index 192159adc4c..6a595670920 100644 --- a/src/hotspot/cpu/s390/vmstorage_s390.hpp +++ b/src/hotspot/cpu/s390/vmstorage_s390.hpp @@ -29,24 +29,79 @@ #include "asm/register.hpp" enum class StorageType : int8_t { - STACK = 0, - PLACEHOLDER = 1, -// special locations used only by native code - FRAME_DATA = PLACEHOLDER + 1, + INTEGER = 0, + FLOAT = 1, + STACK = 2, + PLACEHOLDER = 3, + // special locations used only by native code + FRAME_DATA = 4, INVALID = -1 }; // need to define this before constructing VMStorage (below) constexpr inline bool VMStorage::is_reg(StorageType type) { - return false; + return type == StorageType::INTEGER || type == StorageType::FLOAT; } constexpr inline StorageType VMStorage::stack_type() { return StorageType::STACK; } constexpr inline StorageType VMStorage::placeholder_type() { return StorageType::PLACEHOLDER; } constexpr inline StorageType VMStorage::frame_data_type() { return StorageType::FRAME_DATA; } +// Needs to be consistent with S390Architecture.java. +constexpr uint16_t REG32_MASK = 0b0000000000000001; +constexpr uint16_t REG64_MASK = 0b0000000000000011; + +inline Register as_Register(VMStorage vms) { + assert(vms.type() == StorageType::INTEGER, "not the right type"); + return ::as_Register(vms.index()); +} + +inline FloatRegister as_FloatRegister(VMStorage vms) { + assert(vms.type() == StorageType::FLOAT, "not the right type"); + return ::as_FloatRegister(vms.index()); +} + +inline VMStorage as_VMStorage(Register reg, uint16_t segment_mask = REG64_MASK) { + return VMStorage::reg_storage(StorageType::INTEGER, segment_mask, reg->encoding()); +} + +inline VMStorage as_VMStorage(FloatRegister reg, uint16_t segment_mask = REG64_MASK) { + return VMStorage::reg_storage(StorageType::FLOAT, segment_mask, reg->encoding()); +} + inline VMStorage as_VMStorage(VMReg reg, BasicType bt) { + if (reg->is_Register()) { + uint16_t segment_mask = 0; + switch (bt) { + case T_BOOLEAN: + case T_CHAR : + case T_BYTE : + case T_SHORT : + case T_INT : segment_mask = REG32_MASK; break; + default : segment_mask = REG64_MASK; break; + } + return as_VMStorage(reg->as_Register(), segment_mask); + } else if (reg->is_FloatRegister()) { + // FP regs always use double format. However, we need the correct format for loads /stores. + return as_VMStorage(reg->as_FloatRegister(), (bt == T_FLOAT) ? REG32_MASK : REG64_MASK); + } else if (reg->is_stack()) { + uint16_t size = 0; + switch (bt) { + case T_BOOLEAN: + case T_CHAR : + case T_BYTE : + case T_SHORT : + case T_INT : + case T_FLOAT : size = 4; break; + default : size = 8; break; + } + return VMStorage(StorageType::STACK, size, + checked_cast(reg->reg2stack() * VMRegImpl::stack_slot_size)); + } else if (!reg->is_valid()) { + return VMStorage::invalid(); + } + ShouldNotReachHere(); return VMStorage::invalid(); } -#endif // CPU_S390_VMSTORAGE_S390_INLINE_HPP \ No newline at end of file +#endif // CPU_S390_VMSTORAGE_S390_INLINE_HPP diff --git a/src/java.base/share/classes/jdk/internal/foreign/CABI.java b/src/java.base/share/classes/jdk/internal/foreign/CABI.java index eee4ae67457..d376a196333 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/CABI.java +++ b/src/java.base/share/classes/jdk/internal/foreign/CABI.java @@ -41,6 +41,7 @@ public enum CABI { WIN_AARCH_64, LINUX_PPC_64_LE, LINUX_RISCV_64, + LINUX_S390, FALLBACK, UNSUPPORTED; @@ -81,7 +82,11 @@ private static CABI computeCurrent() { if (OperatingSystem.isLinux()) { return LINUX_RISCV_64; } - } + } else if (arch.equals("s390x")) { + if (OperatingSystem.isLinux()) { + return LINUX_S390; + } + } } else if (FallbackLinker.isSupported()) { return FALLBACK; // fallback linker } diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java b/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java index b5eb1029ff5..8a322cdcf7a 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java @@ -32,6 +32,7 @@ import jdk.internal.foreign.abi.fallback.FallbackLinker; import jdk.internal.foreign.abi.ppc64.linux.LinuxPPC64leLinker; import jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64Linker; +import jdk.internal.foreign.abi.s390.linux.LinuxS390Linker; import jdk.internal.foreign.abi.x64.sysv.SysVx64Linker; import jdk.internal.foreign.abi.x64.windows.Windowsx64Linker; import jdk.internal.foreign.layout.AbstractLayout; @@ -60,7 +61,8 @@ public abstract sealed class AbstractLinker implements Linker permits LinuxAArch64Linker, MacOsAArch64Linker, SysVx64Linker, WindowsAArch64Linker, Windowsx64Linker, LinuxPPC64leLinker, - LinuxRISCV64Linker, FallbackLinker { + LinuxRISCV64Linker, LinuxS390Linker, + FallbackLinker { public interface UpcallStubFactory { MemorySegment makeStub(MethodHandle target, Arena arena); diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java b/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java index 1e417245543..92d10a1dbdf 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java @@ -35,6 +35,7 @@ import jdk.internal.foreign.abi.fallback.FallbackLinker; import jdk.internal.foreign.abi.ppc64.linux.LinuxPPC64leLinker; import jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64Linker; +import jdk.internal.foreign.abi.s390.linux.LinuxS390Linker; import jdk.internal.foreign.abi.x64.sysv.SysVx64Linker; import jdk.internal.foreign.abi.x64.windows.Windowsx64Linker; import jdk.internal.vm.annotation.ForceInline; @@ -242,6 +243,7 @@ public static Linker getSystemLinker() { case WIN_AARCH_64 -> WindowsAArch64Linker.getInstance(); case LINUX_PPC_64_LE -> LinuxPPC64leLinker.getInstance(); case LINUX_RISCV_64 -> LinuxRISCV64Linker.getInstance(); + case LINUX_S390 -> LinuxS390Linker.getInstance(); case FALLBACK -> FallbackLinker.getInstance(); case UNSUPPORTED -> throw new UnsupportedOperationException("Platform does not support native linker"); }; diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java new file mode 100644 index 00000000000..bbafef2f3dc --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/S390Architecture.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023 IBM Corp. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.internal.foreign.abi.s390; + +import jdk.internal.foreign.abi.ABIDescriptor; +import jdk.internal.foreign.abi.Architecture; +import jdk.internal.foreign.abi.StubLocations; +import jdk.internal.foreign.abi.VMStorage; + +public final class S390Architecture implements Architecture { + public static final Architecture INSTANCE = new S390Architecture(); + + // Needs to be consistent with vmstorage_s390.hpp. + public static final short REG32_MASK = 0b0000_0000_0000_0001; + public static final short REG64_MASK = 0b0000_0000_0000_0011; + + private static final int INTEGER_REG_SIZE = 8; + private static final int FLOAT_REG_SIZE = 8; + private static final int STACK_SLOT_SIZE = 8; + + // Suppresses default constructor, ensuring non-instantiability. + private S390Architecture() { + } + + @Override + public boolean isStackType(int cls) { + return cls == StorageType.STACK; + } + + @Override + public int typeSize(int cls) { + switch (cls) { + case StorageType.INTEGER: + return INTEGER_REG_SIZE; + case StorageType.FLOAT: + return FLOAT_REG_SIZE; + // STACK is deliberately omitted + } + + throw new IllegalArgumentException("Invalid Storage Class: " + cls); + } + + public interface StorageType { + byte INTEGER = 0; + byte FLOAT = 1; + byte STACK = 2; + byte PLACEHOLDER = 3; + } + + public static class Regs { // break circular dependency + public static final VMStorage r0 = integerRegister(0); + public static final VMStorage r1 = integerRegister(1); + public static final VMStorage r2 = integerRegister(2); + public static final VMStorage r3 = integerRegister(3); + public static final VMStorage r4 = integerRegister(4); + public static final VMStorage r5 = integerRegister(5); + public static final VMStorage r6 = integerRegister(6); + public static final VMStorage r7 = integerRegister(7); + public static final VMStorage r8 = integerRegister(8); + public static final VMStorage r9 = integerRegister(9); + public static final VMStorage r10 = integerRegister(10); + public static final VMStorage r11 = integerRegister(11); + public static final VMStorage r12 = integerRegister(12); + public static final VMStorage r13 = integerRegister(13); + public static final VMStorage r14 = integerRegister(14); + public static final VMStorage r15 = integerRegister(15); + + public static final VMStorage f0 = floatRegister(0); + public static final VMStorage f1 = floatRegister(1); + public static final VMStorage f2 = floatRegister(2); + public static final VMStorage f3 = floatRegister(3); + public static final VMStorage f4 = floatRegister(4); + public static final VMStorage f5 = floatRegister(5); + public static final VMStorage f6 = floatRegister(6); + public static final VMStorage f7 = floatRegister(7); + public static final VMStorage f8 = floatRegister(8); + public static final VMStorage f9 = floatRegister(9); + public static final VMStorage f10 = floatRegister(10); + public static final VMStorage f11 = floatRegister(11); + public static final VMStorage f12 = floatRegister(12); + public static final VMStorage f13 = floatRegister(13); + public static final VMStorage f14 = floatRegister(14); + public static final VMStorage f15 = floatRegister(15); + } + + private static VMStorage integerRegister(int index) { + return new VMStorage(StorageType.INTEGER, REG64_MASK, index, "r" + index); + } + + private static VMStorage floatRegister(int index) { + return new VMStorage(StorageType.FLOAT, REG64_MASK, index, "f" + index); + } + + public static VMStorage stackStorage(short size, int byteOffset) { + return new VMStorage(StorageType.STACK, size, byteOffset); + } + + public static ABIDescriptor abiFor(VMStorage[] inputIntRegs, + VMStorage[] inputFloatRegs, + VMStorage[] outputIntRegs, + VMStorage[] outputFloatRegs, + VMStorage[] volatileIntRegs, + VMStorage[] volatileFloatRegs, + int stackAlignment, + int shadowSpace, + VMStorage scratch1, VMStorage scratch2) { + return new ABIDescriptor( + INSTANCE, + new VMStorage[][] { + inputIntRegs, + inputFloatRegs, + }, + new VMStorage[][] { + outputIntRegs, + outputFloatRegs, + }, + new VMStorage[][] { + volatileIntRegs, + volatileFloatRegs, + }, + stackAlignment, + shadowSpace, + scratch1, scratch2, + StubLocations.TARGET_ADDRESS.storage(StorageType.PLACEHOLDER), + StubLocations.RETURN_BUFFER.storage(StorageType.PLACEHOLDER), + StubLocations.CAPTURED_STATE_BUFFER.storage(StorageType.PLACEHOLDER)); + } +} diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java new file mode 100644 index 00000000000..84392e45089 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390CallArranger.java @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023 IBM Corp. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.internal.foreign.abi.s390.linux; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import jdk.internal.foreign.abi.ABIDescriptor; +import jdk.internal.foreign.abi.AbstractLinker.UpcallStubFactory; +import jdk.internal.foreign.abi.Binding; +import jdk.internal.foreign.abi.CallingSequence; +import jdk.internal.foreign.abi.CallingSequenceBuilder; +import jdk.internal.foreign.abi.DowncallLinker; +import jdk.internal.foreign.abi.LinkerOptions; +import jdk.internal.foreign.abi.UpcallLinker; +import jdk.internal.foreign.abi.SharedUtils; +import jdk.internal.foreign.abi.VMStorage; +import jdk.internal.foreign.Utils; + +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import static jdk.internal.foreign.abi.s390.linux.TypeClass.*; +import static jdk.internal.foreign.abi.s390.S390Architecture.*; +import static jdk.internal.foreign.abi.s390.S390Architecture.Regs.*; + +/** + * For the S390 C ABI specifically, this class uses CallingSequenceBuilder + * to translate a C FunctionDescriptor into a CallingSequence, which can then be turned into a MethodHandle. + * + * This includes taking care of synthetic arguments like pointers to return buffers for 'in-memory' returns. + */ +public class LinuxS390CallArranger { + + private static final int STACK_SLOT_SIZE = 8; + public static final int MAX_REGISTER_ARGUMENTS = 5; + public static final int MAX_FLOAT_REGISTER_ARGUMENTS = 4; + + private static final ABIDescriptor CLinux = abiFor( + new VMStorage[] { r2, r3, r4, r5, r6, }, // GP input + new VMStorage[] { f0, f2, f4, f6 }, // FP input + new VMStorage[] { r2, }, // GP output + new VMStorage[] { f0, }, // FP output + new VMStorage[] { r0, r1, r2, r3, r4, r5, r14 }, // volatile GP + new VMStorage[] { f1, f3, f5, f7 }, // volatile FP (excluding argument registers) + 8, // Stack is always 8 byte aligned on S390 + 160, // ABI header + r0, r1 // scratch reg r0 & r1 + ); + + public record Bindings(CallingSequence callingSequence, boolean isInMemoryReturn) {} + + public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall) { + return getBindings(mt, cDesc, forUpcall, LinkerOptions.empty()); + } + + public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall, LinkerOptions options) { + CallingSequenceBuilder csb = new CallingSequenceBuilder(CLinux, forUpcall, options); + + BindingCalculator argCalc = forUpcall ? new BoxBindingCalculator(true) : new UnboxBindingCalculator(true); + BindingCalculator retCalc = forUpcall ? new UnboxBindingCalculator(false) : new BoxBindingCalculator(false); + + boolean returnInMemory = isInMemoryReturn(cDesc.returnLayout()); + if (returnInMemory) { + Class carrier = MemorySegment.class; + MemoryLayout layout =SharedUtils.C_POINTER; + csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout)); + } else if (cDesc.returnLayout().isPresent()) { + Class carrier = mt.returnType(); + MemoryLayout layout = cDesc.returnLayout().get(); + csb.setReturnBindings(carrier, layout, retCalc.getBindings(carrier, layout)); + } + + for (int i = 0; i < mt.parameterCount(); i++) { + Class carrier = mt.parameterType(i); + MemoryLayout layout = cDesc.argumentLayouts().get(i); + csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout)); + } + + return new Bindings(csb.build(), returnInMemory); + } + + public static MethodHandle arrangeDowncall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options) { + Bindings bindings = getBindings(mt, cDesc, false, options); + + MethodHandle handle = new DowncallLinker(CLinux, bindings.callingSequence).getBoundMethodHandle(); + + if (bindings.isInMemoryReturn) { + handle = SharedUtils.adaptDowncallForIMR(handle, cDesc, bindings.callingSequence); + } + + return handle; + } + + public static UpcallStubFactory arrangeUpcall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options) { + Bindings bindings = getBindings(mt, cDesc, true, options); + + final boolean dropReturn = true; /* drop return, since we don't have bindings for it */ + return SharedUtils.arrangeUpcallHelper(mt, bindings.isInMemoryReturn, dropReturn, CLinux, + bindings.callingSequence); + } + + private static boolean isInMemoryReturn(Optional returnLayout) { + return returnLayout + .filter(layout -> layout instanceof GroupLayout) + .isPresent(); + } + + static class StorageCalculator { + private final boolean forArguments; + + private final int[] nRegs = new int[] { 0, 0 }; + private long stackOffset = 0; + + public StorageCalculator(boolean forArguments) { + this.forArguments = forArguments; + } + + VMStorage stackAlloc(long size, long alignment) { + long alignedStackOffset = Utils.alignUp(stackOffset, alignment); + + short encodedSize = (short) size; + assert (encodedSize & 0xFFFF) == size; + + VMStorage storage = stackStorage(encodedSize, (int) alignedStackOffset); + stackOffset = alignedStackOffset + size; + return storage; + } + + VMStorage regAlloc(int type) { + int gpRegCnt = (type == StorageType.INTEGER) ? 1 : 0; + int fpRegCnt = (type == StorageType.FLOAT) ? 1 : 0; + + // Use stack if not enough registers available. + if ((type == StorageType.FLOAT && (nRegs[StorageType.FLOAT] + fpRegCnt) > MAX_FLOAT_REGISTER_ARGUMENTS) + || (type == StorageType.INTEGER && (nRegs[StorageType.INTEGER] + gpRegCnt) > MAX_REGISTER_ARGUMENTS)) return null; + + VMStorage[] source = (forArguments ? CLinux.inputStorage : CLinux.outputStorage)[type]; + VMStorage result = source[nRegs[type]]; + + nRegs[StorageType.INTEGER] += gpRegCnt; + nRegs[StorageType.FLOAT] += fpRegCnt; + return result; + + } + VMStorage getStorage(int type, boolean is32Bit) { + VMStorage reg = regAlloc(type); + if (reg != null) { + if (is32Bit) { + reg = new VMStorage(reg.type(), REG32_MASK, reg.indexOrOffset()); + } + return reg; + } + VMStorage stack; + if (is32Bit) { + stackAlloc(4, STACK_SLOT_SIZE); // Skip first half of stack slot. + stack = stackAlloc(4, 4); + } else + stack = stackAlloc(8, STACK_SLOT_SIZE); + + return stack; + } + } + + abstract static class BindingCalculator { + protected final StorageCalculator storageCalculator; + + protected BindingCalculator(boolean forArguments) { + this.storageCalculator = new LinuxS390CallArranger.StorageCalculator(forArguments); + } + + abstract List getBindings(Class carrier, MemoryLayout layout); + } + + // Compute recipe for transferring arguments / return values to C from Java. + static class UnboxBindingCalculator extends BindingCalculator { + UnboxBindingCalculator(boolean forArguments) { + super(forArguments); + } + + @Override + List getBindings(Class carrier, MemoryLayout layout) { + TypeClass argumentClass = TypeClass.classifyLayout(layout); + Binding.Builder bindings = Binding.builder(); + switch (argumentClass) { + case STRUCT_REGISTER -> { + assert carrier == MemorySegment.class; + VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); + Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), false); + bindings.bufferLoad(0, type) + .vmStore(storage, type); + } + case STRUCT_SFA -> { + assert carrier == MemorySegment.class; + VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, layout.byteSize() == 4); + Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), true); + bindings.bufferLoad(0, type) + .vmStore(storage, type); + } + case STRUCT_REFERENCE -> { + assert carrier == MemorySegment.class; + bindings.copy(layout) + .unboxAddress(); + VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); + bindings.vmStore(storage, long.class); + } + case POINTER -> { + VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); + bindings.unboxAddress() + .vmStore(storage, long.class); + } + case INTEGER -> { + // ABI requires all int types to get extended to 64 bit. + VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); + bindings.vmStore(storage, carrier); + } + case FLOAT -> { + VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, carrier == float.class); + bindings.vmStore(storage, carrier); + } + default -> throw new UnsupportedOperationException("Unhandled class " + argumentClass); + } + return bindings.build(); + } + } + + // Compute recipe for transferring arguments / return values from C to Java. + static class BoxBindingCalculator extends BindingCalculator { + BoxBindingCalculator(boolean forArguments) { + super(forArguments); + } + + @Override + List getBindings(Class carrier, MemoryLayout layout) { + TypeClass argumentClass = TypeClass.classifyLayout(layout); + Binding.Builder bindings = Binding.builder(); + switch (argumentClass) { + case STRUCT_REGISTER -> { + assert carrier == MemorySegment.class; + bindings.allocate(layout) + .dup(); + VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); + Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), false); + bindings.vmLoad(storage, type) + .bufferStore(0, type); + } + case STRUCT_SFA -> { + assert carrier == MemorySegment.class; + bindings.allocate(layout) + .dup(); + VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, layout.byteSize() == 4); + Class type = SharedUtils.primitiveCarrierForSize(layout.byteSize(), true); + bindings.vmLoad(storage, type) + .bufferStore(0, type); + } + case STRUCT_REFERENCE -> { + assert carrier == MemorySegment.class; + VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); + bindings.vmLoad(storage, long.class) + .boxAddress(layout); + } + case POINTER -> { + AddressLayout addressLayout = (AddressLayout) layout; + VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); + bindings.vmLoad(storage, long.class) + .boxAddressRaw(Utils.pointeeByteSize(addressLayout), Utils.pointeeByteAlign(addressLayout)); + } + case INTEGER -> { + // We could use carrier != long.class for BoxBindingCalculator, but C always uses 64 bit slots. + VMStorage storage = storageCalculator.getStorage(StorageType.INTEGER, false); + bindings.vmLoad(storage, carrier); + } + case FLOAT -> { + VMStorage storage = storageCalculator.getStorage(StorageType.FLOAT, carrier == float.class); + bindings.vmLoad(storage, carrier); + } + default -> throw new UnsupportedOperationException("Unhandled class " + argumentClass); + } + return bindings.build(); + } + } +} diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java new file mode 100644 index 00000000000..ac004b9e1e0 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/LinuxS390Linker.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023 IBM Corp. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.internal.foreign.abi.s390.linux; + +import jdk.internal.foreign.abi.AbstractLinker; +import jdk.internal.foreign.abi.LinkerOptions; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.nio.ByteOrder; + +public final class LinuxS390Linker extends AbstractLinker { + + public static LinuxS390Linker getInstance() { + final class Holder { + private static final LinuxS390Linker INSTANCE = new LinuxS390Linker(); + } + + return Holder.INSTANCE; + } + + private LinuxS390Linker() { + // Ensure there is only one instance + } + + @Override + protected MethodHandle arrangeDowncall(MethodType inferredMethodType, FunctionDescriptor function, LinkerOptions options) { + return LinuxS390CallArranger.arrangeDowncall(inferredMethodType, function, options); + } + + @Override + protected UpcallStubFactory arrangeUpcall(MethodType targetType, FunctionDescriptor function, LinkerOptions options) { + return LinuxS390CallArranger.arrangeUpcall(targetType, function, options); + } + + @Override + protected ByteOrder linkerByteOrder() { + return ByteOrder.BIG_ENDIAN; + } +} diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java new file mode 100644 index 00000000000..095cb2c08a8 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/s390/linux/TypeClass.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023 IBM Corp. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.internal.foreign.abi.s390.linux; + +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SequenceLayout; +import java.lang.foreign.ValueLayout; +import java.util.List; +import java.util.ArrayList; + +public enum TypeClass { + STRUCT_REGISTER, + STRUCT_SFA, // Single Float Aggregate + STRUCT_REFERENCE, + POINTER, + INTEGER, + FLOAT; + + private static TypeClass classifyValueType(ValueLayout type) { + Class carrier = type.carrier(); + if (carrier == boolean.class || carrier == byte.class || carrier == char.class || + carrier == short.class || carrier == int.class || carrier == long.class) { + return INTEGER; + } else if (carrier == float.class || carrier == double.class) { + return FLOAT; + } else if (carrier == MemorySegment.class) { + return POINTER; + } else { + throw new IllegalStateException("Cannot get here: " + carrier.getName()); + } + } + + private static boolean isRegisterAggregate(MemoryLayout type) { + long byteSize = type.byteSize(); + if (byteSize > 8 || byteSize == 3 || byteSize == 5 || byteSize == 6 || byteSize == 7) + return false; + return true; + } + + static List scalarLayouts(GroupLayout gl) { + List out = new ArrayList<>(); + scalarLayoutsInternal(out, gl); + return out; + } + + private static void scalarLayoutsInternal(List out, GroupLayout gl) { + for (MemoryLayout member : gl.memberLayouts()) { + if (member instanceof GroupLayout memberGl) { + scalarLayoutsInternal(out, memberGl); + } else if (member instanceof SequenceLayout memberSl) { + for (long i = 0; i < memberSl.elementCount(); i++) { + out.add(memberSl.elementLayout()); + } + } else { + // padding or value layouts + out.add(member); + } + } + } + + static boolean isSingleFloatAggregate(MemoryLayout type) { + List scalarLayouts = scalarLayouts((GroupLayout) type); + + final int numElements = scalarLayouts.size(); + if (numElements > 1 || numElements == 0) + return false; + + MemoryLayout baseType = scalarLayouts.get(0); + + if (!(baseType instanceof ValueLayout)) + return false; + + TypeClass baseArgClass = classifyValueType((ValueLayout) baseType); + if (baseArgClass != FLOAT) + return false; + + return true; + } + + private static TypeClass classifyStructType(MemoryLayout layout) { + + if (!isRegisterAggregate(layout)) { + return TypeClass.STRUCT_REFERENCE; + } + + if (isSingleFloatAggregate(layout)) { + return TypeClass.STRUCT_SFA; + } + return TypeClass.STRUCT_REGISTER; + } + + public static TypeClass classifyLayout(MemoryLayout type) { + if (type instanceof ValueLayout) { + return classifyValueType((ValueLayout) type); + } else if (type instanceof GroupLayout) { + return classifyStructType(type); + } else { + throw new IllegalArgumentException("Unsupported layout: " + type); + } + } +} diff --git a/test/jdk/java/foreign/TestClassLoaderFindNative.java b/test/jdk/java/foreign/TestClassLoaderFindNative.java index 3f5fec0c195..44ec8732ed4 100644 --- a/test/jdk/java/foreign/TestClassLoaderFindNative.java +++ b/test/jdk/java/foreign/TestClassLoaderFindNative.java @@ -31,9 +31,10 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SymbolLookup; +import java.nio.ByteOrder; import org.testng.annotations.Test; -import static java.lang.foreign.ValueLayout.JAVA_BYTE; +import static java.lang.foreign.ValueLayout.JAVA_INT; import static org.testng.Assert.*; // FYI this test is run on 64-bit platforms only for now, @@ -58,8 +59,8 @@ public void testInvalidSymbolLookup() { @Test public void testVariableSymbolLookup() { - MemorySegment segment = SymbolLookup.loaderLookup().find("c").get().reinterpret(1); - assertEquals(segment.get(JAVA_BYTE, 0), 42); + MemorySegment segment = SymbolLookup.loaderLookup().find("c").get().reinterpret(4); + assertEquals(segment.get(JAVA_INT, 0), 42); } @Test diff --git a/test/jdk/java/foreign/TestIllegalLink.java b/test/jdk/java/foreign/TestIllegalLink.java index 12a5bba5753..b898ad09a49 100644 --- a/test/jdk/java/foreign/TestIllegalLink.java +++ b/test/jdk/java/foreign/TestIllegalLink.java @@ -53,6 +53,7 @@ public class TestIllegalLink extends NativeTestHelper { private static final boolean IS_SYSV = CABI.current() == CABI.SYS_V; + private static final boolean IS_LE = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN; private static final MemorySegment DUMMY_TARGET = MemorySegment.ofAddress(1); private static final MethodHandle DUMMY_TARGET_MH = MethodHandles.empty(MethodType.methodType(void.class)); @@ -112,27 +113,27 @@ public static Object[][] types() { { FunctionDescriptor.of(MemoryLayout.sequenceLayout(2, C_INT)), NO_OPTIONS, - "Unsupported layout: [2:i4]" + IS_LE ? "Unsupported layout: [2:i4]" : "Unsupported layout: [2:I4]" }, { FunctionDescriptor.ofVoid(MemoryLayout.sequenceLayout(2, C_INT)), NO_OPTIONS, - "Unsupported layout: [2:i4]" + IS_LE ? "Unsupported layout: [2:i4]" : "Unsupported layout: [2:I4]" }, { FunctionDescriptor.ofVoid(C_INT.withByteAlignment(2)), NO_OPTIONS, - "Unsupported layout: 2%i4" + IS_LE ? "Unsupported layout: 2%i4" : "Unsupported layout: 2%I4" }, { FunctionDescriptor.ofVoid(C_POINTER.withByteAlignment(2)), NO_OPTIONS, - "Unsupported layout: 2%a8" + IS_LE ? "Unsupported layout: 2%a8" : "Unsupported layout: 2%A8" }, { FunctionDescriptor.ofVoid(ValueLayout.JAVA_CHAR.withByteAlignment(4)), NO_OPTIONS, - "Unsupported layout: 4%c2" + IS_LE ? "Unsupported layout: 4%c2" : "Unsupported layout: 4%C2" }, { FunctionDescriptor.ofVoid(MemoryLayout.structLayout( @@ -141,7 +142,7 @@ public static Object[][] types() { C_INT.withName("z").withByteAlignment(1) ).withByteAlignment(1)), NO_OPTIONS, - "Unsupported layout: 1%s2" + IS_LE ? "Unsupported layout: 1%s2" : "Unsupported layout: 1%S2" }, { FunctionDescriptor.ofVoid(MemoryLayout.structLayout( @@ -151,7 +152,7 @@ public static Object[][] types() { C_INT.withName("z").withByteAlignment(1) ))), NO_OPTIONS, - "Unsupported layout: 1%s2" + IS_LE ? "Unsupported layout: 1%s2" : "Unsupported layout: 1%S2" }, { FunctionDescriptor.ofVoid(MemoryLayout.structLayout( @@ -159,7 +160,7 @@ public static Object[][] types() { C_INT.withByteAlignment(1) ))), NO_OPTIONS, - "Unsupported layout: 1%i4" + IS_LE ? "Unsupported layout: 1%i4" : "Unsupported layout: 1%I4" }, { FunctionDescriptor.ofVoid(MemoryLayout.structLayout( @@ -172,17 +173,17 @@ public static Object[][] types() { { FunctionDescriptor.of(C_INT.withOrder(nonNativeOrder())), NO_OPTIONS, - "Unsupported layout: I4" + IS_LE ? "Unsupported layout: I4" : "Unsupported layout: i4" }, { FunctionDescriptor.of(MemoryLayout.structLayout(C_INT.withOrder(nonNativeOrder()))), NO_OPTIONS, - "Unsupported layout: I4" + IS_LE ? "Unsupported layout: I4" : "Unsupported layout: i4" }, { FunctionDescriptor.of(MemoryLayout.structLayout(MemoryLayout.sequenceLayout(C_INT.withOrder(nonNativeOrder())))), NO_OPTIONS, - "Unsupported layout: I4" + IS_LE ? "Unsupported layout: I4" : "Unsupported layout: i4" }, { FunctionDescriptor.ofVoid(MemoryLayout.structLayout( @@ -226,5 +227,4 @@ private static ByteOrder nonNativeOrder() { ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN; } - } diff --git a/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java b/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java index c2af2e8acdd..48ca23befef 100644 --- a/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java +++ b/test/jdk/java/foreign/callarranger/platform/PlatformLayouts.java @@ -303,5 +303,4 @@ private RISCV64() {} public static final AddressLayout C_POINTER = SharedUtils.C_POINTER; } - } From 8939d15d92982300f090bc1c51f59550529eaaf3 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 21 Aug 2023 08:28:31 +0000 Subject: [PATCH 122/162] 8314100: G1: Improve collection set candidate selection code Reviewed-by: ayang, iwalulya --- .../share/gc/g1/g1CollectionSetChooser.cpp | 50 +++++++++---------- .../share/gc/g1/g1CollectionSetChooser.hpp | 5 -- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp b/src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp index 8cd05ae3113..28132ea172b 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp +++ b/src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp @@ -131,14 +131,11 @@ class G1BuildCandidateRegionsTask : public WorkerTask { assert(_cur_chunk_idx < _cur_chunk_end, "Must be"); _array->set(_cur_chunk_idx, hr); - _cur_chunk_idx++; _regions_added++; } - bool should_add(HeapRegion* hr) { return G1CollectionSetChooser::should_add(hr); } - public: G1BuildCandidateRegionsClosure(G1BuildCandidateArray* array) : _array(array), @@ -147,20 +144,32 @@ class G1BuildCandidateRegionsTask : public WorkerTask { _regions_added(0) { } bool do_heap_region(HeapRegion* r) { - // We will skip any region that's currently used as an old GC - // alloc region (we should not consider those for collection - // before we fill them up). - if (should_add(r) && !G1CollectedHeap::heap()->is_old_gc_alloc_region(r)) { - assert(r->rem_set()->is_complete(), "must be %u", r->hrm_index()); + // Candidates from marking are always old; also keep regions that are already + // collection set candidates (some retained regions) in that list. + if (!r->is_old() || r->is_collection_set_candidate()) { + // Keep remembered sets and everything for these regions. + return false; + } + + // Can not add a region without a remembered set to the candidates. + assert(!r->rem_set()->is_updating(), "must be"); + if (!r->rem_set()->is_complete()) { + return false; + } + + // Skip any region that is currently used as an old GC alloc region. We should + // not consider those for collection before we fill them up as the effective + // gain from them is small. I.e. we only actually reclaim from the filled part, + // as the remainder is still eligible for allocation. These objects are also + // likely to have already survived a few collections, so they might be longer + // lived anyway. + // Otherwise the Old region must satisfy the liveness condition. + bool should_add = !G1CollectedHeap::heap()->is_old_gc_alloc_region(r) && + G1CollectionSetChooser::region_occupancy_low_enough_for_evac(r->live_bytes()); + if (should_add) { add_region(r); - } else if (r->is_old() && !r->is_collection_set_candidate()) { - // Keep remembered sets for humongous regions and collection set candidates, - // otherwise clean them out. - r->rem_set()->clear(true /* only_cardset */); } else { - assert(r->is_collection_set_candidate() || !r->is_old() || !r->rem_set()->is_tracked(), - "Missed to clear unused remembered set of region %u (%s) that is %s", - r->hrm_index(), r->get_type_str(), r->rem_set()->get_state_str()); + r->rem_set()->clear(true /* only_cardset */); } return false; } @@ -252,17 +261,6 @@ uint G1CollectionSetChooser::calculate_work_chunk_size(uint num_workers, uint nu return MAX2(num_regions / num_workers, 1U); } -bool G1CollectionSetChooser::should_add(HeapRegion* hr) { - return !hr->is_young() && - !hr->is_humongous() && - // A region might have been retained (after evacuation failure) and already put - // into the candidates list during concurrent marking. These should keep being - // considered as retained regions. - !hr->is_collection_set_candidate() && - region_occupancy_low_enough_for_evac(hr->live_bytes()) && - hr->rem_set()->is_complete(); -} - void G1CollectionSetChooser::build(WorkerThreads* workers, uint max_num_regions, G1CollectionSetCandidates* candidates) { uint num_workers = workers->active_workers(); uint chunk_size = calculate_work_chunk_size(num_workers, max_num_regions); diff --git a/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp b/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp index b11d507c226..5b005205551 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp +++ b/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp @@ -47,11 +47,6 @@ class G1CollectionSetChooser : public AllStatic { return live_bytes < mixed_gc_live_threshold_bytes(); } - // Determine whether to add the given region to the collection set candidates from - // marking or not. Currently, we skip regions whose live bytes are over the threshold. - // Regions also need a complete remembered set to be a candidate. - static bool should_add(HeapRegion* hr); - // Build and return set of collection set candidates sorted by decreasing gc // efficiency. static void build(WorkerThreads* workers, uint max_num_regions, G1CollectionSetCandidates* candidates); From 812f475bc4ea84225e8bbb0b5a677eed0af864dd Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 21 Aug 2023 09:02:01 +0000 Subject: [PATCH 123/162] 8314501: Shenandoah: sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java fails Reviewed-by: cjplummer, sspitsyn --- .../share/classes/sun/jvm/hotspot/tools/HeapSummary.java | 7 +++---- .../jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index d29e3a68811..c586a20e866 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -86,10 +86,8 @@ public void run() { printValMB("MetaspaceSize = ", getFlagValue("MetaspaceSize", flagMap)); printValMB("CompressedClassSpaceSize = ", getFlagValue("CompressedClassSpaceSize", flagMap)); printValMB("MaxMetaspaceSize = ", getFlagValue("MaxMetaspaceSize", flagMap)); - if (heap instanceof ShenandoahHeap) { - printValMB("ShenandoahRegionSize = ", ShenandoahHeapRegion.regionSizeBytes()); - } else { - printValMB("G1HeapRegionSize = ", HeapRegion.grainBytes()); + if (heap instanceof G1CollectedHeap) { + printValMB("G1HeapRegionSize = ", HeapRegion.grainBytes()); } System.out.println(); @@ -138,6 +136,7 @@ public void run() { long num_regions = sh.numOfRegions(); System.out.println("Shenandoah Heap:"); System.out.println(" regions = " + num_regions); + printValMB("region size = ", ShenandoahHeapRegion.regionSizeBytes()); printValMB("capacity = ", num_regions * ShenandoahHeapRegion.regionSizeBytes()); printValMB("used = ", sh.used()); printValMB("committed = ", sh.committed()); diff --git a/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java b/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java index 71d112157b2..119ab55afca 100644 --- a/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java +++ b/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java @@ -57,8 +57,7 @@ public class JMapHeapConfigTest { "NewRatio", "SurvivorRatio", "MetaspaceSize", - "CompressedClassSpaceSize", - "G1HeapRegionSize"}; + "CompressedClassSpaceSize"}; // Test can't deal with negative jlongs: // ignoring MaxMetaspaceSize From abac60851c8fd341cdaaf62286afc83699b74eeb Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Mon, 21 Aug 2023 12:15:26 +0000 Subject: [PATCH 124/162] 8313962: G1: Refactor G1ConcurrentMark::_num_concurrent_workers Reviewed-by: tschatzl, iwalulya --- src/hotspot/share/gc/g1/g1ConcurrentMark.cpp | 23 +++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index aeaedf8b0ef..5bef45fb152 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -436,11 +436,11 @@ G1ConcurrentMark::G1ConcurrentMark(G1CollectedHeap* g1h, log_debug(gc)("ConcGCThreads: %u offset %u", ConcGCThreads, _worker_id_offset); log_debug(gc)("ParallelGCThreads: %u", ParallelGCThreads); - _num_concurrent_workers = ConcGCThreads; - _max_concurrent_workers = _num_concurrent_workers; + _max_concurrent_workers = ConcGCThreads; _concurrent_workers = new WorkerThreads("G1 Conc", _max_concurrent_workers); _concurrent_workers->initialize_workers(); + _num_concurrent_workers = _concurrent_workers->active_workers(); if (!_global_mark_stack.initialize(MarkStackSize, MarkStackSizeMax)) { vm_exit_during_initialization("Failed to allocate initial concurrent mark overflow mark stack."); @@ -976,17 +976,14 @@ void G1ConcurrentMark::scan_root_regions() { if (root_regions()->scan_in_progress()) { assert(!has_aborted(), "Aborting before root region scanning is finished not supported."); - _num_concurrent_workers = MIN2(calc_active_marking_workers(), - // We distribute work on a per-region basis, so starting - // more threads than that is useless. - root_regions()->num_root_regions()); - assert(_num_concurrent_workers <= _max_concurrent_workers, - "Maximum number of marking threads exceeded"); + // Assign one worker to each root-region but subject to the max constraint. + const uint num_workers = MIN2(root_regions()->num_root_regions(), + _max_concurrent_workers); G1CMRootRegionScanTask task(this); log_debug(gc, ergo)("Running %s using %u workers for %u work units.", - task.name(), _num_concurrent_workers, root_regions()->num_root_regions()); - _concurrent_workers->run_task(&task, _num_concurrent_workers); + task.name(), num_workers, root_regions()->num_root_regions()); + _concurrent_workers->run_task(&task, num_workers); // It's possible that has_aborted() is true here without actually // aborting the survivor scan earlier. This is OK as it's @@ -1046,9 +1043,7 @@ void G1ConcurrentMark::concurrent_cycle_end(bool mark_cycle_completed) { void G1ConcurrentMark::mark_from_roots() { _restart_for_overflow = false; - _num_concurrent_workers = calc_active_marking_workers(); - - uint active_workers = MAX2(1U, _num_concurrent_workers); + uint active_workers = calc_active_marking_workers(); // Setting active workers is not guaranteed since fewer // worker threads may currently exist and more may not be @@ -1056,6 +1051,8 @@ void G1ConcurrentMark::mark_from_roots() { active_workers = _concurrent_workers->set_active_workers(active_workers); log_info(gc, task)("Using %u workers of %u for marking", active_workers, _concurrent_workers->max_workers()); + _num_concurrent_workers = active_workers; + // Parallel task terminator is set in "set_concurrency_and_phase()" set_concurrency_and_phase(active_workers, true /* concurrent */); From 0b3f452d2577d92ce0c5e3e2d8140a93740245b5 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Mon, 21 Aug 2023 12:17:38 +0000 Subject: [PATCH 125/162] 8314161: G1: Fix -Wconversion warnings in G1CardSetConfiguration::_bitmap_hash_mask Reviewed-by: tschatzl, iwalulya --- src/hotspot/share/gc/g1/g1CardSet.cpp | 2 +- src/hotspot/share/gc/g1/g1CardSet.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSet.cpp b/src/hotspot/share/gc/g1/g1CardSet.cpp index f39e2066739..58ae441f51f 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.cpp +++ b/src/hotspot/share/gc/g1/g1CardSet.cpp @@ -110,7 +110,7 @@ G1CardSetConfiguration::G1CardSetConfiguration(uint inline_ptr_bits_per_card, _max_cards_in_howl_bitmap(G1CardSetHowl::bitmap_size(_max_cards_in_card_set, _num_buckets_in_howl)), _cards_in_howl_bitmap_threshold(_max_cards_in_howl_bitmap * cards_in_bitmap_threshold_percent), _log2_max_cards_in_howl_bitmap(log2i_exact(_max_cards_in_howl_bitmap)), - _bitmap_hash_mask(~(~(0) << _log2_max_cards_in_howl_bitmap)), + _bitmap_hash_mask((1U << _log2_max_cards_in_howl_bitmap) - 1), _log2_card_regions_per_heap_region(log2_card_regions_per_heap_region), _log2_cards_per_card_region(log2i_exact(_max_cards_in_card_set)) { diff --git a/src/hotspot/share/gc/g1/g1CardSet.hpp b/src/hotspot/share/gc/g1/g1CardSet.hpp index 5511ebee256..a9f1859d5c7 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.hpp +++ b/src/hotspot/share/gc/g1/g1CardSet.hpp @@ -55,7 +55,7 @@ class G1CardSetConfiguration { uint _max_cards_in_howl_bitmap; uint _cards_in_howl_bitmap_threshold; uint _log2_max_cards_in_howl_bitmap; - size_t _bitmap_hash_mask; + uint _bitmap_hash_mask; uint _log2_card_regions_per_heap_region; uint _log2_cards_per_card_region; From 17a19dc06062331c954fa519a4f668664b1533c9 Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Mon, 21 Aug 2023 12:19:36 +0000 Subject: [PATCH 126/162] 8311639: Replace currentTimeMillis() with nanoTime() in jtreg/gc Reviewed-by: stefank, ayang --- .../jtreg/gc/cslocker/TestCSLocker.java | 10 +--- ...rReclaimHumongousRegionsClearMarkBits.java | 10 ++-- .../gc/g1/TestPeriodicCollectionJNI.java | 10 +--- .../TestNoAllocationsInHRegions.java | 8 +-- .../TestUnifiedLoggingSwitchStress.java | 8 +-- .../gc/shenandoah/TestStringDedupStress.java | 6 +- .../gc/shenandoah/jni/TestJNIGlobalRefs.java | 10 ++-- .../mxbeans/TestChurnNotifications.java | 6 +- .../mxbeans/TestPauseNotifications.java | 6 +- .../TestJNIBlockFullGC.java | 26 ++++----- .../gc/stress/TestMultiThreadStressRSet.java | 16 +++--- .../gc/stress/TestStressRSetCoarsening.java | 18 +++--- .../gc/stress/gcbasher/TestGCBasher.java | 8 +-- .../TestExcessGCLockerCollections.java | 18 ++---- .../gc/stress/gclocker/TestGCLocker.java | 55 ++++++++++--------- .../jtreg/gc/stress/gcold/TestGCOld.java | 8 +-- .../gc/stress/systemgc/TestSystemGC.java | 14 ++--- 17 files changed, 112 insertions(+), 125 deletions(-) diff --git a/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java b/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java index 69b67684fab..2a6e3a1bfd0 100644 --- a/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java +++ b/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,10 +44,8 @@ public class TestCSLocker extends Thread { - static int timeout = 5000; + static int timeoutMillis = 5000; public static void main(String args[]) throws Exception { - long startTime = System.currentTimeMillis(); - // start garbage producer thread GarbageProducer garbageProducer = new GarbageProducer(1000000, 10); garbageProducer.start(); @@ -61,9 +59,7 @@ public static void main(String args[]) throws Exception { // code until unlock() is called below. // check timeout to success deadlocking - while (System.currentTimeMillis() < startTime + timeout) { - sleep(1000); - } + sleep(timeoutMillis); csLocker.unlock(); garbageProducer.interrupt(); diff --git a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java index 37d77860cca..774929c4799 100644 --- a/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java +++ b/test/hotspot/jtreg/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ class ObjectWithSomeRefs { } class TestEagerReclaimHumongousRegionsClearMarkBitsReclaimRegionFast { - public static final long MAX_MILLIS_FOR_RUN = 50 * 1000; // The maximum runtime for the actual test. + public static final long MAX_NANOS_FOR_RUN = 50L * 1_000_000_000L; // The maximum runtime for the actual test. public static final int M = 1024*1024; @@ -93,11 +93,11 @@ public static void main(String[] args) { Object ref_from_stack = large1; - long start_millis = System.currentTimeMillis(); + long start_nanos = System.nanoTime(); for (int i = 0; i < 20; i++) { - long current_millis = System.currentTimeMillis(); - if ((current_millis - start_millis) > MAX_MILLIS_FOR_RUN) { + long current_nanos = System.nanoTime(); + if ((current_nanos - start_nanos) > MAX_NANOS_FOR_RUN) { System.out.println("Finishing test because maximum runtime exceeded"); break; } diff --git a/test/hotspot/jtreg/gc/g1/TestPeriodicCollectionJNI.java b/test/hotspot/jtreg/gc/g1/TestPeriodicCollectionJNI.java index a688ca0a076..9a2dfcb98ea 100644 --- a/test/hotspot/jtreg/gc/g1/TestPeriodicCollectionJNI.java +++ b/test/hotspot/jtreg/gc/g1/TestPeriodicCollectionJNI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,8 +57,7 @@ public static void block() { } public static void main(String[] args) throws InterruptedException { - long timeout = 2000; - long startTime = System.currentTimeMillis(); + long timeoutMillis = 2000; // Start thread doing JNI call BlockInNative blocker = new BlockInNative(); @@ -66,10 +65,7 @@ public static void main(String[] args) throws InterruptedException { try { // Wait for periodic GC timeout to trigger - while (System.currentTimeMillis() < startTime + timeout) { - System.out.println("Sleeping to let periodic GC trigger..."); - Thread.sleep(200); - } + Thread.sleep(timeoutMillis); } finally { unblock(); } diff --git a/test/hotspot/jtreg/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java b/test/hotspot/jtreg/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java index eb25042d6dc..184daa07b7c 100644 --- a/test/hotspot/jtreg/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java +++ b/test/hotspot/jtreg/gc/g1/humongousObjects/TestNoAllocationsInHRegions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -178,11 +178,11 @@ public static void main(String[] args) { } // test duration - long duration = Integer.parseInt(args[0]) * 1000L; + long durationNanos = Integer.parseInt(args[0]) * 1_000_000_000L; // part of heap preallocated with humongous objects (in percents) int percentOfAllocatedHeap = Integer.parseInt(args[1]); - long startTime = System.currentTimeMillis(); + long startTimeNanos = System.nanoTime(); long initialFreeRegionsCount = WB.g1NumFreeRegions(); int regionsToAllocate = (int) ((double) initialFreeRegionsCount / 100.0 * percentOfAllocatedHeap); @@ -219,7 +219,7 @@ public static void main(String[] args) { threads.stream().forEach(Thread::start); - while ((System.currentTimeMillis() - startTime < duration) && error == null) { + while ((System.nanoTime() - startTimeNanos < durationNanos) && error == null) { Thread.yield(); } diff --git a/test/hotspot/jtreg/gc/logging/TestUnifiedLoggingSwitchStress.java b/test/hotspot/jtreg/gc/logging/TestUnifiedLoggingSwitchStress.java index 67fe474b42a..a1604a2b05e 100644 --- a/test/hotspot/jtreg/gc/logging/TestUnifiedLoggingSwitchStress.java +++ b/test/hotspot/jtreg/gc/logging/TestUnifiedLoggingSwitchStress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -222,9 +222,9 @@ public static void main(String[] args) throws InterruptedException { if (args.length != 1) { throw new Error("Test Bug: Expected duration (in seconds) wasn't provided as command line argument"); } - long duration = Integer.parseInt(args[0]) * 1000; + long durationNanos = Integer.parseInt(args[0]) * 1_000_000_000L; - long startTime = System.currentTimeMillis(); + long startTimeNanos = System.nanoTime(); List threads = new LinkedList<>(); @@ -238,7 +238,7 @@ public static void main(String[] args) throws InterruptedException { threads.stream().forEach(Thread::start); - while (System.currentTimeMillis() - startTime < duration) { + while (System.nanoTime() - startTimeNanos < durationNanos) { Thread.yield(); } diff --git a/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java b/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java index 90b383d0587..0382d0e00dd 100644 --- a/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java +++ b/test/hotspot/jtreg/gc/shenandoah/TestStringDedupStress.java @@ -113,7 +113,7 @@ public class TestStringDedupStress { private static final int TARGET_STRINGS = Integer.getInteger("targetStrings", 2_500_000); private static final long MAX_REWRITE_GC_CYCLES = 6; - private static final long MAX_REWRITE_TIME = 30*1000; // ms + private static final long MAX_REWRITE_TIME_NS = 30L * 1_000_000_000L; // 30s in ns private static final int UNIQUE_STRINGS = 20; @@ -211,7 +211,7 @@ public static void main(String[] args) { } long cycleBeforeRewrite = gcCycleMBean.getCollectionCount(); - long timeBeforeRewrite = System.currentTimeMillis(); + long timeBeforeRewriteNanos = System.nanoTime(); long loop = 1; while (true) { @@ -229,7 +229,7 @@ public static void main(String[] args) { } // enough time is spent waiting for GC to happen - if (System.currentTimeMillis() - timeBeforeRewrite >= MAX_REWRITE_TIME) { + if (System.nanoTime() - timeBeforeRewriteNanos >= MAX_REWRITE_TIME_NS) { break; } } diff --git a/test/hotspot/jtreg/gc/shenandoah/jni/TestJNIGlobalRefs.java b/test/hotspot/jtreg/gc/shenandoah/jni/TestJNIGlobalRefs.java index 64520391f25..d2a34ccb6af 100644 --- a/test/hotspot/jtreg/gc/shenandoah/jni/TestJNIGlobalRefs.java +++ b/test/hotspot/jtreg/gc/shenandoah/jni/TestJNIGlobalRefs.java @@ -49,7 +49,7 @@ public class TestJNIGlobalRefs { System.loadLibrary("TestJNIGlobalRefs"); } - private static final int TIME_MSEC = 120000; + private static final long TIME_NSEC = 120L * 1_000_000_000L; private static final int ARRAY_SIZE = 10000; private static native void makeGlobalRef(Object o); @@ -60,13 +60,13 @@ public class TestJNIGlobalRefs { public static void main(String[] args) throws Throwable { seedGlobalRef(); seedWeakGlobalRef(); - long start = System.currentTimeMillis(); - long current = start; - while (current - start < TIME_MSEC) { + long startNanos = System.nanoTime(); + long currentNanos = startNanos; + while (currentNanos - startNanos < TIME_NSEC) { testGlobal(); testWeakGlobal(); Thread.sleep(1); - current = System.currentTimeMillis(); + currentNanos = System.nanoTime(); } } diff --git a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java index e83b85c62b8..96586b27f65 100644 --- a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java +++ b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestChurnNotifications.java @@ -129,7 +129,7 @@ public class TestChurnNotifications { static volatile Object sink; public static void main(String[] args) throws Exception { - final long startTime = System.currentTimeMillis(); + final long startTimeNanos = System.nanoTime(); final AtomicLong churnBytes = new AtomicLong(); @@ -176,8 +176,8 @@ public void handleNotification(Notification n, Object o) { // Look at test timeout to figure out how long we can wait without breaking into timeout. // Default to 1/4 of the remaining time in 1s steps. final long STEP_MS = 1000; - long spentTime = System.currentTimeMillis() - startTime; - long maxTries = (Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT) - spentTime) / STEP_MS / 4; + long spentTimeNanos = System.nanoTime() - startTimeNanos; + long maxTries = (Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT) - (spentTimeNanos / 1_000_000L)) / STEP_MS / 4; // Wait until enough notifications are accrued to match minimum boundary. long tries = 0; diff --git a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java index 796806569b5..0919a21d370 100644 --- a/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java +++ b/test/hotspot/jtreg/gc/shenandoah/mxbeans/TestPauseNotifications.java @@ -122,7 +122,7 @@ private static boolean isExpectedPauseAction(String action) { } public static void main(String[] args) throws Exception { - final long startTime = System.currentTimeMillis(); + final long startTimeNanos = System.nanoTime(); final AtomicLong pausesDuration = new AtomicLong(); final AtomicLong cyclesDuration = new AtomicLong(); @@ -173,8 +173,8 @@ public void handleNotification(Notification n, Object o) { // Look at test timeout to figure out how long we can wait without breaking into timeout. // Default to 1/4 of the remaining time in 1s steps. final long STEP_MS = 1000; - long spentTime = System.currentTimeMillis() - startTime; - long maxTries = (Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT) - spentTime) / STEP_MS / 4; + long spentTimeNanos = System.nanoTime() - startTimeNanos; + long maxTries = (Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT) - (spentTimeNanos / 1_000_000L)) / STEP_MS / 4; long actualPauses = 0; long actualCycles = 0; diff --git a/test/hotspot/jtreg/gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java b/test/hotspot/jtreg/gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java index 09173ef925a..6a336e7b9f1 100644 --- a/test/hotspot/jtreg/gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java +++ b/test/hotspot/jtreg/gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017 SAP SE and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -62,12 +62,12 @@ public Node(int load) { } } - public static void warmUp(long warmupEndTime, int size, long seed) { + public static void warmUp(long warmupEndTimeNanos, int size, long seed) { Random r = new Random(seed); // First let the GC assume most of our objects will die. Node[] roots = new Node[size]; - while (System.currentTimeMillis() < warmupEndTime) { + while (System.nanoTime() - warmupEndTimeNanos < 0) { int index = (int) (r.nextDouble() * roots.length); roots[index] = new Node(1); } @@ -78,7 +78,7 @@ public static void warmUp(long warmupEndTime, int size, long seed) { } } - public static void runTest(long endTime, int size, double alive, long seed) { + public static void runTest(long endTimeNanos, int size, double alive, long seed) { Random r = new Random(seed); final int length = 10000; int[] array1 = new int[length]; @@ -91,7 +91,7 @@ public static void runTest(long endTime, int size, double alive, long seed) { int index = 0; roots[0] = new Node(0); - while (!hadError && (System.currentTimeMillis() < endTime)) { + while (!hadError && (System.nanoTime() - endTimeNanos < 0)) { int test_val1 = TestCriticalArray0(array1); if (r.nextDouble() > alive) { @@ -136,15 +136,15 @@ public static void main(String[] args) throws Exception { int warmupThreads = Integer.parseInt(args[0]); System.out.println("# Warmup Threads = " + warmupThreads); - int warmupDuration = Integer.parseInt(args[1]); - System.out.println("WarmUp Duration = " + warmupDuration); + long warmupDurationNanos = 1_000_000L * Integer.parseInt(args[1]); + System.out.println("WarmUp Duration Millis = " + args[1]); int warmupIterations = Integer.parseInt(args[2]); System.out.println("# Warmup Iterations = "+ warmupIterations); int mainThreads = Integer.parseInt(args[3]); System.out.println("# Main Threads = " + mainThreads); - int mainDuration = Integer.parseInt(args[4]); - System.out.println("Main Duration = " + mainDuration); + long mainDurationNanos = 1_000_000L * Integer.parseInt(args[4]); + System.out.println("Main Duration Millis = " + args[4]); int mainIterations = Integer.parseInt(args[5]); System.out.println("# Main Iterations = " + mainIterations); @@ -154,12 +154,12 @@ public static void main(String[] args) throws Exception { Thread threads[] = new Thread[Math.max(warmupThreads, mainThreads)]; System.out.println("Start warm-up threads!"); - long warmupStartTime = System.currentTimeMillis(); + long warmupStartTimeNanos = System.nanoTime(); for (int i = 0; i < warmupThreads; i++) { long seed = rng.nextLong(); threads[i] = new Thread() { public void run() { - warmUp(warmupStartTime + warmupDuration, warmupIterations, seed); + warmUp(warmupStartTimeNanos + warmupDurationNanos, warmupIterations, seed); }; }; threads[i].start(); @@ -170,12 +170,12 @@ public void run() { System.gc(); System.out.println("Keep alive a lot"); - long startTime = System.currentTimeMillis(); + long startTimeNanos = System.nanoTime(); for (int i = 0; i < mainThreads; i++) { long seed = rng.nextLong(); threads[i] = new Thread() { public void run() { - runTest(startTime + mainDuration, mainIterations, liveFrac, seed); + runTest(startTimeNanos + mainDurationNanos, mainIterations, liveFrac, seed); }; }; threads[i].start(); diff --git a/test/hotspot/jtreg/gc/stress/TestMultiThreadStressRSet.java b/test/hotspot/jtreg/gc/stress/TestMultiThreadStressRSet.java index 567451919d2..0c742b7b4ef 100644 --- a/test/hotspot/jtreg/gc/stress/TestMultiThreadStressRSet.java +++ b/test/hotspot/jtreg/gc/stress/TestMultiThreadStressRSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,7 +111,7 @@ public static void main(String args[]) { } long time = Long.parseLong(args[0]); int threads = Integer.parseInt(args[1]); - new TestMultiThreadStressRSet().test(time * 1000, threads); + new TestMultiThreadStressRSet().test(time * 1_000_000_000L, threads); } /** @@ -147,23 +147,23 @@ public TestMultiThreadStressRSet() { *
  • stops the Shifter thread * * - * @param timeInMillis how long to stress + * @param timeInNanos how long to stress * @param maxThreads the maximum number of Worker thread working together. */ - public void test(long timeInMillis, int maxThreads) { - if (timeInMillis <= 0 || maxThreads <= 0) { + public void test(long timeInNanos, int maxThreads) { + if (timeInNanos <= 0 || maxThreads <= 0) { throw new IllegalArgumentException("TEST BUG: be positive!"); } - System.out.println("%% Time to work: " + timeInMillis / 1000 + "s"); + System.out.println("%% Time to work: " + timeInNanos / 1_000_000_000L + "s"); System.out.println("%% Number of threads: " + maxThreads); - long finish = System.currentTimeMillis() + timeInMillis; + long finishNanos = System.nanoTime() + timeInNanos; Shifter shift = new Shifter(this, 1000, (int) (windowSize * 0.9)); shift.start(); for (int i = 0; i < maxThreads; i++) { new Worker(this, 100).start(); } try { - while (System.currentTimeMillis() < finish && errorMessage == null) { + while (System.nanoTime() - finishNanos < 0 && errorMessage == null) { Thread.sleep(100); } } catch (Throwable t) { diff --git a/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java b/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java index 2930990a3db..e4761ca4b4a 100644 --- a/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java +++ b/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -139,23 +139,23 @@ public static void main(String... args) throws InterruptedException { /** * Initial time. */ - public final long start; + public final long startNanos; /** * Time when the test should stop working. */ - public final long finishAt; + public final long finishAtNanos; /** * Does pre-calculation and allocate necessary objects. * * @param objPerRegions how many objects per G1 heap region */ - TestStressRSetCoarsening(int objPerRegions, int regsToRefresh, int timeout) { + TestStressRSetCoarsening(int objPerRegions, int regsToRefresh, int timeoutSec) { this.K = objPerRegions; this.regsToRefresh = regsToRefresh; - this.start = System.currentTimeMillis(); - this.finishAt = start + timeout * 900; // 10% ahead of jtreg timeout + this.startNanos = System.nanoTime(); + this.finishAtNanos = startNanos + (timeoutSec * 900_000_000L); // 10% ahead of jtreg timeout long regionSize = WB.g1RegionSize(); @@ -284,7 +284,7 @@ public void go() throws InterruptedException { for (int rn = pre; rn != cur; rn += step) { Object[] rnArray = storage.getArrayAt(getY(to, from, rn)); rnArray[getX(to, from, rn)] = celebrity; - if (System.currentTimeMillis() > finishAt) { + if (System.nanoTime() - finishAtNanos > 0) { throw new TimeoutException(); } } @@ -322,9 +322,9 @@ public void go() throws InterruptedException { } catch (TimeoutException e) { System.out.println("%% TIMEOUT!!!"); } - long now = System.currentTimeMillis(); + long nowNanos = System.nanoTime(); System.out.println("%% Summary"); - System.out.println("%% Time spent : " + ((now - start) / 1000) + " seconds"); + System.out.println("%% Time spent : " + ((nowNanos - startNanos) / 1_000_000_000L) + " seconds"); System.out.println("%% Free memory left : " + Runtime.getRuntime().freeMemory() / KB + "K"); System.out.println("%% Test passed"); } diff --git a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasher.java b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasher.java index 453482facc4..43be11c3da9 100644 --- a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasher.java +++ b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,9 +57,9 @@ public static void main(String[] args) throws IOException { return; } - long durationMillis = Long.valueOf(args[0]); - long start = System.currentTimeMillis(); - while (System.currentTimeMillis() - start < durationMillis) { + long durationNanos = Long.valueOf(args[0]) * 1_000_000L; + long startNanos = System.nanoTime(); + while (System.nanoTime() - startNanos < durationNanos) { parseClassFiles(); } } diff --git a/test/hotspot/jtreg/gc/stress/gclocker/TestExcessGCLockerCollections.java b/test/hotspot/jtreg/gc/stress/gclocker/TestExcessGCLockerCollections.java index 8b6326b1cae..deaf08748a6 100644 --- a/test/hotspot/jtreg/gc/stress/gclocker/TestExcessGCLockerCollections.java +++ b/test/hotspot/jtreg/gc/stress/gclocker/TestExcessGCLockerCollections.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -133,18 +133,12 @@ static public void main(String args[]) { new Thread(new JNICriticalWorker()).start(); } - long durationMS = (long) (1000 * durationSec); - long start = System.currentTimeMillis(); - long now = start; - long soFar = now - start; - while (soFar < durationMS) { - try { - Thread.sleep(durationMS - soFar); - } catch (Exception e) { - } - now = System.currentTimeMillis(); - soFar = now - start; + try { + Thread.sleep(durationSec * 1000L); + } catch (InterruptedException e) { + throw new RuntimeException("Test Failure, did not expect an InterruptedException", e); } + println("Done."); keepRunning = false; } diff --git a/test/hotspot/jtreg/gc/stress/gclocker/TestGCLocker.java b/test/hotspot/jtreg/gc/stress/gclocker/TestGCLocker.java index 5d1b7315074..36b9a59fde6 100644 --- a/test/hotspot/jtreg/gc/stress/gclocker/TestGCLocker.java +++ b/test/hotspot/jtreg/gc/stress/gclocker/TestGCLocker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,16 +78,16 @@ class MemoryWatcher { private MemoryPoolMXBean bean; private final int thresholdPromille = 750; private final int criticalThresholdPromille = 800; - private final int minGCWaitMS = 1000; - private final int minFreeWaitElapsedMS = 30000; - private final int minFreeCriticalWaitMS; + private final long minGCWaitNanos = 1_000_000_000L; + private final long minFreeWaitElapsedNanos = 30L * 1_000_000_000L; + private final long minFreeCriticalWaitNanos; private int lastUsage = 0; - private long lastGCDetected = System.currentTimeMillis(); - private long lastFree = System.currentTimeMillis(); + private long lastGCDetectedNanos = System.nanoTime(); + private long lastFreeNanos = System.nanoTime(); - public MemoryWatcher(String mxBeanName, int minFreeCriticalWaitMS) { - this.minFreeCriticalWaitMS = minFreeCriticalWaitMS; + public MemoryWatcher(String mxBeanName, long minFreeCriticalWaitNanos) { + this.minFreeCriticalWaitNanos = minFreeCriticalWaitNanos; List memoryBeans = ManagementFactory.getMemoryPoolMXBeans(); for (MemoryPoolMXBean bean : memoryBeans) { if (bean.getName().equals(mxBeanName)) { @@ -111,25 +111,25 @@ private int getMemoryUsage() { public synchronized boolean shouldFreeUpSpace() { int usage = getMemoryUsage(); - long now = System.currentTimeMillis(); + long nowNanos = System.nanoTime(); boolean detectedGC = false; if (usage < lastUsage) { - lastGCDetected = now; + lastGCDetectedNanos = nowNanos; detectedGC = true; } lastUsage = usage; - long elapsed = now - lastFree; - long timeSinceLastGC = now - lastGCDetected; + long elapsedNanos = nowNanos - lastFreeNanos; + long timeSinceLastGCNanos = nowNanos - lastGCDetectedNanos; - if (usage > criticalThresholdPromille && elapsed > minFreeCriticalWaitMS) { - lastFree = now; + if (usage > criticalThresholdPromille && elapsedNanos > minFreeCriticalWaitNanos) { + lastFreeNanos = nowNanos; return true; } else if (usage > thresholdPromille && !detectedGC) { - if (elapsed > minFreeWaitElapsedMS || timeSinceLastGC > minGCWaitMS) { - lastFree = now; + if (elapsedNanos > minFreeWaitElapsedNanos || timeSinceLastGCNanos > minGCWaitNanos) { + lastFreeNanos = nowNanos; return true; } } @@ -152,8 +152,8 @@ private void load() { cache.add(new Filler()); } - public MemoryUser(String mxBeanName, int minFreeCriticalWaitMS) { - watcher = new MemoryWatcher(mxBeanName, minFreeCriticalWaitMS); + public MemoryUser(String mxBeanName, long minFreeCriticalWaitNanos) { + watcher = new MemoryWatcher(mxBeanName, minFreeCriticalWaitNanos); } @Override @@ -192,8 +192,8 @@ private static Exitable startGCLockerStresser(String name) { return task; } - private static Exitable startMemoryUser(String mxBeanName, int minFreeCriticalWaitMS) { - MemoryUser task = new MemoryUser(mxBeanName, minFreeCriticalWaitMS); + private static Exitable startMemoryUser(String mxBeanName, long minFreeCriticalWaitNanos) { + MemoryUser task = new MemoryUser(mxBeanName, minFreeCriticalWaitNanos); Thread thread = new Thread(task); thread.setName("Memory User"); @@ -207,17 +207,18 @@ public static void main(String[] args) { long durationMinutes = args.length > 0 ? Long.parseLong(args[0]) : 5; String mxBeanName = args.length > 1 ? args[1] : null; - int minFreeCriticalWaitMS = args.length > 2 ? Integer.parseInt(args[2]) : 500; - - long startMS = System.currentTimeMillis(); + long minFreeCriticalWaitNanos = args.length > 2 + ? Integer.parseInt(args[2]) * 1_000_000L + : 500_000_000L; Exitable stresser1 = startGCLockerStresser("GCLockerStresser1"); Exitable stresser2 = startGCLockerStresser("GCLockerStresser2"); - Exitable memoryUser = startMemoryUser(mxBeanName, minFreeCriticalWaitMS); + Exitable memoryUser = startMemoryUser(mxBeanName, minFreeCriticalWaitNanos); - long durationMS = durationMinutes * 60 * 1000; - while ((System.currentTimeMillis() - startMS) < durationMS) { - ThreadUtils.sleep(10 * 1010); + try { + Thread.sleep(durationMinutes * 60_000L); + } catch (InterruptedException e) { + throw new RuntimeException("Test Failure, did not except an InterruptedException", e); } stresser1.exit(); diff --git a/test/hotspot/jtreg/gc/stress/gcold/TestGCOld.java b/test/hotspot/jtreg/gc/stress/gcold/TestGCOld.java index ade4aad35a5..a1cc167cca0 100644 --- a/test/hotspot/jtreg/gc/stress/gcold/TestGCOld.java +++ b/test/hotspot/jtreg/gc/stress/gcold/TestGCOld.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -369,14 +369,14 @@ public static void main(String[] args) { System.err.println("Initialization complete..."); - long start = System.currentTimeMillis(); + long startNanos = System.nanoTime(); for (int step = 0; step < steps; step++) { doStep(MEG); } - long end = System.currentTimeMillis(); - float secs = ((float)(end-start))/1000.0F; + long endNanos = System.nanoTime(); + float secs = (endNanos - startNanos) / 1_000_000_000F; // checkTrees(); diff --git a/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java b/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java index 8b89efb7940..58cc6f05c8c 100644 --- a/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java +++ b/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -104,7 +104,7 @@ public void run() { } public class TestSystemGC { - private static long endTime; + private static long endTimeNanos; private static final int numGroups = 7; private static final int numGCsPerGroup = 4; @@ -137,7 +137,7 @@ private static void doSystemGCs() { for (int i = 0; i < numGroups; i++) { for (int j = 0; j < numGCsPerGroup; j++) { System.gc(); - if (System.currentTimeMillis() >= endTime) { + if (System.nanoTime() - endTimeNanos >= 0) { return; } ThreadUtils.sleep(getDelayMS(i)); @@ -165,7 +165,7 @@ private static void exitTask(Exitable task) { } private static void runAllPhases() { - for (int i = 0; i < 4 && System.currentTimeMillis() < endTime; i++) { + for (int i = 0; i < 4 && System.nanoTime() - endTimeNanos < 0; i++) { SystemGCTask gcTask = (i % 2 == 1) ? createSystemGCTask(numGroups / 3) : null; ShortLivedAllocationTask shortTask = @@ -191,9 +191,9 @@ public static void main(String[] args) throws Exception { if (args.length == 0) { throw new IllegalArgumentException("Must specify timeout in seconds as first argument"); } - int timeout = Integer.parseInt(args[0]) * 1000; - System.out.println("Running with timeout of " + timeout + "ms"); - endTime = System.currentTimeMillis() + timeout; + long timeoutNanos = Integer.parseInt(args[0]) * 1_000_000_000L; + System.out.println("Running with timeout of " + args[0] + " seconds"); + endTimeNanos = System.nanoTime() + timeoutNanos; // First allocate the long lived objects and then run all phases. populateLongLived(); runAllPhases(); From 78f74bc8ff1e673991d91a55ef70880d9fb3f6b5 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Mon, 21 Aug 2023 17:13:48 +0000 Subject: [PATCH 127/162] 8314672: ProblemList runtime/cds/appcds/customLoader/HelloCustom_JFR.java on linux-all and windows-x64 Reviewed-by: azvegint --- test/hotspot/jtreg/ProblemList-zgc.txt | 2 -- test/hotspot/jtreg/ProblemList.txt | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList-zgc.txt b/test/hotspot/jtreg/ProblemList-zgc.txt index 815860250fe..d9863b4690b 100644 --- a/test/hotspot/jtreg/ProblemList-zgc.txt +++ b/test/hotspot/jtreg/ProblemList-zgc.txt @@ -45,5 +45,3 @@ vmTestbase/gc/gctests/MemoryEaterMT/MemoryEaterMT.java 8289582 windows- vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded002/TestDescription.java 8298302 generic-all vmTestbase/nsk/sysdict/vm/stress/chain/chain007/chain007.java 8298991 linux-x64 - -runtime/cds/appcds/customLoader/HelloCustom_JFR.java 8241075 linux-all diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 4b85f929999..8445fbc661e 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -103,6 +103,7 @@ runtime/CompressedOops/CompressedClassPointers.java 8305765 generic-all runtime/StackGuardPages/TestStackGuardPagesNative.java 8303612 linux-all runtime/ErrorHandling/TestDwarf.java 8305489 linux-all runtime/ErrorHandling/MachCodeFramesInErrorFile.java 8313315 linux-ppc64le +runtime/cds/appcds/customLoader/HelloCustom_JFR.java 8241075 linux-all,windows-x64 applications/jcstress/copy.java 8229852 linux-all From 87298d2ade41c689d3140981a123b0e9130fc651 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 22 Aug 2023 01:44:16 +0000 Subject: [PATCH 128/162] 8312535: MidiSystem.getSoundbank() throws unexpected SecurityException Reviewed-by: prr --- .../sun/media/sound/JARSoundbankReader.java | 19 ++++--- .../GetSoundBankSecurityException.java | 50 +++++++++++++++++++ .../security.policy | 4 ++ 3 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java create mode 100644 test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy diff --git a/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java b/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java index a207d69c355..6447e654f60 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.io.InputStreamReader; import java.net.URL; import java.net.URLClassLoader; +import java.security.AccessController; import java.util.ArrayList; import java.util.Objects; @@ -40,6 +41,7 @@ import javax.sound.midi.spi.SoundbankReader; import sun.reflect.misc.ReflectUtil; +import sun.security.action.GetBooleanAction; /** * JarSoundbankReader is used to read soundbank object from jar files. @@ -48,12 +50,15 @@ */ public final class JARSoundbankReader extends SoundbankReader { - /* - * Name of the system property that enables the Jar soundbank loading - * true if jar sound bank is allowed to be loaded - * default is false + /** + * Value of the system property that enables the Jar soundbank loading + * {@code true} if jar sound bank is allowed to be loaded default is + * {@code false}. */ - private final static String JAR_SOUNDBANK_ENABLED = "jdk.sound.jarsoundbank"; + @SuppressWarnings("removal") + private static final boolean JAR_SOUNDBANK_ENABLED = + AccessController.doPrivileged( + new GetBooleanAction("jdk.sound.jarsoundbank")); private static boolean isZIP(URL url) { boolean ok = false; @@ -78,7 +83,7 @@ private static boolean isZIP(URL url) { public Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException { Objects.requireNonNull(url); - if (!Boolean.getBoolean(JAR_SOUNDBANK_ENABLED) || !isZIP(url)) + if (!JAR_SOUNDBANK_ENABLED || !isZIP(url)) return null; ArrayList soundbanks = new ArrayList<>(); diff --git a/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java b/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java new file mode 100644 index 00000000000..53f0450f482 --- /dev/null +++ b/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java @@ -0,0 +1,50 @@ +/* + * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +import javax.sound.midi.InvalidMidiDataException; +import javax.sound.midi.MidiSystem; + +/** + * @test + * @bug 8312535 + * @summary MidiSystem.getSoundbank() throws unexpected SecurityException + * @run main/othervm/policy=security.policy GetSoundBankSecurityException + */ +public final class GetSoundBankSecurityException { + + public static void main(String[] args) throws Exception { + File tempFile = new File("sound.bank"); + tempFile.createNewFile(); + try { + MidiSystem.getSoundbank(tempFile); + throw new RuntimeException("InvalidMidiDataException is expected"); + } catch (InvalidMidiDataException ignore) { + } finally { + Files.delete(Paths.get(tempFile.getAbsolutePath())); + } + } +} diff --git a/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy b/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy new file mode 100644 index 00000000000..6c9c2a26aaf --- /dev/null +++ b/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy @@ -0,0 +1,4 @@ +grant { + permission java.io.FilePermission "*", "read,write,delete"; + permission java.util.PropertyPermission "user.dir", "read"; +}; From a66b5df14a163d2990e6dd746906942367e4fdb2 Mon Sep 17 00:00:00 2001 From: Gui Cao Date: Tue, 22 Aug 2023 02:47:52 +0000 Subject: [PATCH 129/162] 8314618: RISC-V: -XX:MaxVectorSize does not work as expected Reviewed-by: fyang, dzhang --- src/hotspot/cpu/riscv/riscv_v.ad | 4 ++-- src/hotspot/cpu/riscv/vm_version_riscv.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/cpu/riscv/riscv_v.ad b/src/hotspot/cpu/riscv/riscv_v.ad index a61e59ef96a..a3e0b50f501 100644 --- a/src/hotspot/cpu/riscv/riscv_v.ad +++ b/src/hotspot/cpu/riscv/riscv_v.ad @@ -880,7 +880,7 @@ instruct vmla(vReg dst_src1, vReg src2, vReg src3) %{ match(Set dst_src1 (AddVI dst_src1 (MulVI src2 src3))); match(Set dst_src1 (AddVL dst_src1 (MulVL src2 src3))); ins_cost(VEC_COST); - format %{ "vmla $dst_src1, $dst_src1, src2, src3" %} + format %{ "vmla $dst_src1, $dst_src1, $src2, $src3" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this); __ vsetvli_helper(bt, Matcher::vector_length(this)); @@ -916,7 +916,7 @@ instruct vmls(vReg dst_src1, vReg src2, vReg src3) %{ match(Set dst_src1 (SubVI dst_src1 (MulVI src2 src3))); match(Set dst_src1 (SubVL dst_src1 (MulVL src2 src3))); ins_cost(VEC_COST); - format %{ "vmls $dst_src1, $dst_src1, src2, src3" %} + format %{ "vmls $dst_src1, $dst_src1, $src2, $src3" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this); __ vsetvli_helper(bt, Matcher::vector_length(this)); diff --git a/src/hotspot/cpu/riscv/vm_version_riscv.cpp b/src/hotspot/cpu/riscv/vm_version_riscv.cpp index 83f6f38d253..cf64e08ebc8 100644 --- a/src/hotspot/cpu/riscv/vm_version_riscv.cpp +++ b/src/hotspot/cpu/riscv/vm_version_riscv.cpp @@ -267,8 +267,8 @@ void VM_Version::c2_initialize() { if (MaxVectorSize > _initial_vector_length) { warning("Current system only supports max RVV vector length %d. Set MaxVectorSize to %d", _initial_vector_length, _initial_vector_length); + MaxVectorSize = _initial_vector_length; } - MaxVectorSize = _initial_vector_length; } else { vm_exit_during_initialization(err_msg("Unsupported MaxVectorSize: %d", (int)MaxVectorSize)); } From ab86d23adfa968a180de67199119fc392e9695c2 Mon Sep 17 00:00:00 2001 From: Julian Waters Date: Tue, 22 Aug 2023 06:12:28 +0000 Subject: [PATCH 130/162] 8250269: Replace ATTRIBUTE_ALIGNED with alignas Reviewed-by: rkennke, kbarrett --- src/hotspot/share/utilities/globalDefinitions.hpp | 2 +- src/hotspot/share/utilities/globalDefinitions_gcc.hpp | 6 +----- src/hotspot/share/utilities/globalDefinitions_visCPP.hpp | 3 --- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp index a374b9cdc93..f6c4199a1e3 100644 --- a/src/hotspot/share/utilities/globalDefinitions.hpp +++ b/src/hotspot/share/utilities/globalDefinitions.hpp @@ -50,7 +50,7 @@ class oopDesc; #endif #ifndef ATTRIBUTE_ALIGNED -#define ATTRIBUTE_ALIGNED(x) +#define ATTRIBUTE_ALIGNED(x) alignas(x) #endif #ifndef ATTRIBUTE_FLATTEN diff --git a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp index 0d7b1164a6d..7ea877062d8 100644 --- a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp +++ b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp @@ -141,7 +141,7 @@ inline int g_isfinite(jdouble f) { return isfinite(f); } // temporarily disabled. #define offset_of(klass,field) \ ([]() { \ - char space[sizeof (klass)] ATTRIBUTE_ALIGNED(16); \ + alignas(16) char space[sizeof (klass)]; \ klass* dummyObj = (klass*)space; \ char* c = (char*)(void*)&dummyObj->field; \ return (size_t)(c - space); \ @@ -160,8 +160,4 @@ inline int g_isfinite(jdouble f) { return isfinite(f); } #define ALWAYSINLINE inline __attribute__ ((always_inline)) #define ATTRIBUTE_FLATTEN __attribute__ ((flatten)) -// Alignment -// -#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x))) - #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP diff --git a/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp b/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp index 25f3ec8cbaf..3b28328d7dd 100644 --- a/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp +++ b/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp @@ -115,9 +115,6 @@ inline int g_isfinite(jdouble f) { return _finite(f); } #define NOINLINE __declspec(noinline) #define ALWAYSINLINE __forceinline -// Alignment -#define ATTRIBUTE_ALIGNED(x) __declspec(align(x)) - #ifdef _M_ARM64 #define USE_VECTORED_EXCEPTION_HANDLING #endif From 02ef859f79cbc2e6225998001af299ba36fe991b Mon Sep 17 00:00:00 2001 From: Cesar Soares Lucas Date: Tue, 22 Aug 2023 07:58:51 +0000 Subject: [PATCH 131/162] 8313689: C2: compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java fails intermittently with -XX:-TieredCompilation Reviewed-by: kvn, thartmann --- .../scalarReplacement/AllocationMergesTests.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java b/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java index aa2f39ef6e6..8effcd63ae7 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java @@ -43,6 +43,9 @@ public static void main(String[] args) { "-XX:+ReduceAllocationMerges", "-XX:+TraceReduceAllocationMerges", "-XX:+DeoptimizeALot", + "-XX:CompileCommand=inline,*::charAt*", + "-XX:CompileCommand=inline,*PicturePositions::*", + "-XX:CompileCommand=inline,*Point::*", "-XX:CompileCommand=exclude,*::dummy*"); } @@ -92,9 +95,11 @@ public static void main(String[] args) { "testString_two_C2" }) public void runner(RunInfo info) { + invocations++; + Random random = info.getRandom(); - boolean cond1 = random.nextBoolean(); - boolean cond2 = random.nextBoolean(); + boolean cond1 = invocations % 2 == 0; + boolean cond2 = !cond1; int l = random.nextInt(); int w = random.nextInt(); @@ -551,9 +556,10 @@ int testSubclassesTrapping(boolean c1, boolean c2, int x, int y, int w, int z) { new F(); } + int res = s.a; dummy(); - return s.a; + return res; } @Test @@ -1196,12 +1202,13 @@ int testSRAndNSR_Trap(boolean is_c2, boolean cond1, boolean cond2, int x, int y) global_escape = p; } + int res = p.x; if (is_c2) { // This will show up to C2 as a trap. dummy_defaults(); } - return p.y; + return res; } @Test From 3e1b1bf94e7acf9717b837085e61fc05a7765de4 Mon Sep 17 00:00:00 2001 From: bobpengxie Date: Tue, 22 Aug 2023 09:21:25 +0000 Subject: [PATCH 132/162] 8314688: VM build without C1 fails after JDK-8313372 Reviewed-by: yzheng, dnsimon, haosun --- .../share/jvmci/jvmciCompilerToVMInit.cpp | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index cf64f3543fb..881f46e86c7 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -22,7 +22,9 @@ */ // no precompiled headers +#ifdef COMPILER1 #include "c1/c1_Compiler.hpp" +#endif #include "ci/ciUtilities.hpp" #include "compiler/compiler_globals.hpp" #include "compiler/oopMap.hpp" @@ -43,7 +45,9 @@ #include "memory/universe.hpp" #include "oops/compressedOops.hpp" #include "oops/klass.inline.hpp" +#ifdef COMPILER2 #include "opto/c2compiler.hpp" +#endif #include "runtime/flags/jvmFlag.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" @@ -225,6 +229,22 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) { #undef SET_TRIGFUNC } +static jboolean is_c1_supported(vmIntrinsics::ID id){ + jboolean supported = false; +#ifdef COMPILER1 + supported = (jboolean) Compiler::is_intrinsic_supported(id); +#endif + return supported; +} + +static jboolean is_c2_supported(vmIntrinsics::ID id){ + jboolean supported = false; +#ifdef COMPILER2 + supported = (jboolean) C2Compiler::is_intrinsic_supported(id); +#endif + return supported; +} + JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) { int len = vmIntrinsics::number_of_intrinsics() - 1; // Exclude vmIntrinsics::_none, which is 0 JVMCIObjectArray vmIntrinsics = JVMCIENV->new_VMIntrinsicMethod_array(len, JVMCI_CHECK_NULL); @@ -243,8 +263,8 @@ JVMCIObjectArray CompilerToVM::initialize_intrinsics(JVMCI_TRAPS) { JVMCIObject sig_str = VM_SYMBOL_TO_STRING(sig); \ JVMCIObject vmIntrinsicMethod = JVMCIENV->new_VMIntrinsicMethod(kls_str, name_str, sig_str, (jint) vmIntrinsics::id, \ (jboolean) vmIntrinsics::is_intrinsic_available(vmIntrinsics::id), \ - (jboolean) Compiler::is_intrinsic_supported(vmIntrinsics::id), \ - (jboolean) C2Compiler::is_intrinsic_supported(vmIntrinsics::id), JVMCI_CHECK_NULL); \ + is_c1_supported(vmIntrinsics::id), \ + is_c2_supported(vmIntrinsics::id), JVMCI_CHECK_NULL); \ JVMCIENV->put_object_at(vmIntrinsics, index++, vmIntrinsicMethod); \ } From 6b9df037e4c3d75d0f413a2bb94d8ce6880ce2fa Mon Sep 17 00:00:00 2001 From: Daohan Qu Date: Tue, 22 Aug 2023 12:51:59 +0000 Subject: [PATCH 133/162] 8311240: Eliminate usage of testcases.jar from TestMetaSpaceLog.java Reviewed-by: ayang, tschatzl --- .../jtreg/gc/logging/TestMetaSpaceLog.java | 34 +++++++----------- test/hotspot/jtreg/gc/logging/testcases.jar | Bin 18020 -> 0 bytes 2 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 test/hotspot/jtreg/gc/logging/testcases.jar diff --git a/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java b/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java index 659f7ed9a47..4a2ad34b3db 100644 --- a/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java +++ b/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java @@ -31,6 +31,8 @@ import java.util.regex.Matcher; import jdk.test.lib.Asserts; +import jdk.test.lib.ByteCodeLoader; +import jdk.test.lib.compiler.InMemoryJavaCompiler; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.whitebox.WhiteBox; @@ -91,9 +93,6 @@ private static boolean check(String line) { } private static void testMetaSpaceUpdate() throws Exception { - // Propagate test.src for the jar file. - String testSrc= "-Dtest.src=" + System.getProperty("test.src", "."); - ProcessBuilder pb = ProcessTools.createTestJvm( "-Xlog:gc*", @@ -102,7 +101,7 @@ private static void testMetaSpaceUpdate() throws Exception { "-XX:+WhiteBoxAPI", "-Xmx1000M", "-Xms1000M", - testSrc, StressMetaSpace.class.getName()); + StressMetaSpace.class.getName()); OutputAnalyzer output = null; try { @@ -117,29 +116,20 @@ private static void testMetaSpaceUpdate() throws Exception { } static class StressMetaSpace { - private static URL[] urls = new URL[1]; - - static { - try { - File jarFile = new File(System.getProperty("test.src") + "/testcases.jar"); - urls[0] = jarFile.toURI().toURL(); - } catch (Exception e) { - e.printStackTrace(); - } - } public static void main(String args[]) { - WhiteBox wb = WhiteBox.getWhiteBox(); - for(int i = 0; i < 10000; i++) { - loadClass(wb); - } - wb.fullGC(); + loadManyClasses(); + WhiteBox.getWhiteBox().fullGC(); } - public static void loadClass(WhiteBox wb) { + public static void loadManyClasses() { + String className = "Tmp"; + String sourceCode = "public class Tmp {}"; + byte[] byteCode = InMemoryJavaCompiler.compile(className, sourceCode); try { - URLClassLoader ucl = new URLClassLoader(urls); - Class.forName("case00", false, ucl); + for (int i = 0; i < 10000; i++) { + ByteCodeLoader.load(className, byteCode); + } } catch (Exception e) { e.printStackTrace(); } diff --git a/test/hotspot/jtreg/gc/logging/testcases.jar b/test/hotspot/jtreg/gc/logging/testcases.jar deleted file mode 100644 index 5996133fe1ed2ca30a11f587abd28de4d6536f77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18020 zcmcIr30M_v2pD!~D1ty_7nEv5#IOYfMOj@+kwscTs4R+rprB|~ zumz#k-JsMD1O*lO+^SY_`CF|ZZPkkU&m=QAlVt3KCtrN>JgB^x_nw@4-gD16H#88C z*P+m8G>TfdoEHW2QliLHf_=liZ2Uvmv))~xPykA3pdtrENfGq0j-OMa0ynno3nusj;O#T$Br5A^;(qOI_?C-e^!FIDKL*y!|l zCet={MRa;P>#tS+^#DOI7BsX4d0jbsvv!4QGSr z9b0oPH2@XBIy5XTCiP$*)wIBKVa(#)IUzAo$4_sVzc49HslWu#9&n{|oX* z+$eQ<8EwIq1A``N1WXO&JPyldf z|7B{cqc8%jsj$*Zg{bC{+f}YIp{hWRDii_wvZIpuSA+rJ5`8E^3aV~0p=wT!Dr{AU zu?efDjxcYKr)nn?1!yFv00IXvx;sI&-r&!TQc#tN1T>P808z18|8mWC@*%)ZOaM}C z!G)k<2p9!=*cx~CUoz%jGVbo?^D1k$FOK<7H@~IP;Cwg#e%-E$3*G!`Ph zf6%4BgBdjcpbP#Fqq(u%garEiXgZJnYcxHc4%C*_aq5y1ySk0bwsETV@2afc{{8b^ zTesClp6xc?L{GcW-|rvX2SjLU>HKz~+xTh0jD(Bb{7U)gugxEA-IxCh{pW^mzFY>2 z#+0+O1oX-tQ4SC0I{IzgpbcDg1|QX^KJDu@;Bba=r=$V?3qcE(VuP|E#1!fMvG6Li zXBDVql-o{BWB!N6=#!x_!U>JR1KCivB(O#MsXMc-K(+wL*+NXk{)e`Jyg+7-5uQin z7`h;PS%aLw7S*(%9k4Cr$=O0oC!=gZ3qj(U1sZ-d_cR4ot@e*eJF+Uq%P(erh?O80 zl@Kfk>V~`ShkGvoeL-Hss4<_`^;C7bXRTUy1+_T8>&6-f=4;0L_lhmK+J5#0Q-q5M zDn8Y`8Ct|n=>6|$shv#pvyr5J!lD$>x1PIP=zF{JyLL(uK4qexjZ)}mMBjOo>SMbW zeJQBQL_Zrz>Zj1E7AVypX{Q>g;G!z6NgDrC3%SQg^v3XeSPn^>x6-|heiX)ANTE@Ws&Wd8%Pi^ zu_B5R1>rgaL3%zY9l3Cs9kU8p>|bq*?LS0t}@ZAHd2~} z+VyolYF9=YYn2pSWg=Q_q(lp~Ye^?+*Sv&*^-^$^iNCgy^4C#0s6z38-D)PR`YaoW zeYy%tt~ZcMupPym)fTQ$XF)~fEHFg!DZvob1s67i!=>pWLNBF5rRg~hNya_k@M!*P z&&#D;e_`<7ul{8-58{?dj-R-LvcY|c^ZvDhP6?f28tO0LNaUS>0|1}RS%6|04>$*zh>Wmkf#@0c<;Q%Ka^=tw#2wB%~OjxtHDib$naf-tp5ms26! zT^H|G&6Q$z$t15TB9&JOgKp5kGs{H0ySi;sG6t^;H!X>q}dNKfZ!z#eTD-~tHa#FK1XT?Iw7+5Nia)2Ka^hg(A3B%;ACF?b#Bbll2T{g^Kg%q%;G^Y*D})LFY7-Wn~$&eJES(Z zZErZ`Q0n?~dL5rP%)U2x#npXBOY^`+3tg)}72y!`M)N7_J7{ryatjpG#i&UH#siY1 zQS`eNM8~z5=vV~z8ML8}$aIaeI38DCS-7LKc~33Afymd8TL7Y$=r>eoIoqqqrPX_y zR%v}(+hOMU#Ewiaow5d{F6$edC7iVsjri;>!C5@}nqOYOyJJL&eWfmcQ#n$5XOVhm zH7|Z)KW#npx@On-`XE|HQi($6t-?r)QaTJsuclKJd^A0j3}(sc%pGVp!i&S&u3Z+i8c-!;P1yj zQ7LFIw6rtimWPO}FY16Vb-euC^Xi@F(^;{xj37tdsc#fL)ckUNV%&8sTSq8{0ZUs~ zSJv0m_xy4C&KApD`e`-b+g$4by%E|Fqo*<{WMJ+Cpp&CB*SBFoatrN`?<+>*O?yw3 z*#Ep)J&3c>%W9Q3X zRR`~h`aN@+^VjDS+yD05#iKuYOIZf5aLUn#+54f@^^selm^4qOgm6HTG>aX}g$Yj? z$f**#TBrk!PCnsrl8GE2AScK06h8YR3l>1~e*LVL)2ZP9= z7e^{{S|T~EOC9fx@QfEY)o9h0pA4K;)zfq9Rk^bLoY#!2={d?P^~Y`X?BZP`71jiP zzs`QDN7(xD@4gz3XWHyLmr=8`F?i+jB`QmAA81wKERCVghP~a2T7T(B$kXqT^L9io zCzgA3X#-{(Q&@b@+h_uOx^uGS8-66|Z-#$KPk zLjm`%YYn~7wS8t_IPH?F$AA8Bqw&ppwa(h8Bek9qU z|N0`nDP_H@$)Hx|qPLZwJ%7{7yc`xV({S)vnQtSt^Z8+ueYEXM(_CWvEl&NRT{!o2 zuCwVoo8N*em8z?lRc)oQO+D%E3zb;Lw)X`3B6nwJ(h<_@brw6$Oh#X7Bpqk|RbOhL z1MMdFu_RERD;J{+s`9(}KovJbK1rD3`emG*w*^|rPo%y$XR$B^ zFiQh40%nJLN91^fHd_{$gq9g3>XiW%)OLOS>jtj5j?>D_)we1Zt$xnqetY{8zx(92 zyl<$&p$D&=3*GQSU{(3|R+uvq#e748lh1nU)NTLaT6W9L_0JlAI!M>p{oVXfFM3y? z?~?;QC+7HQ7wvoB>#eCXPJJ7;ca~rEv)wl5Jlg+Lc*Po}>_FXgXVsBW#@}5w|)W=|Z1$ zrN%ja36ZWQ_f<+dBv?pITJj-bfXM?f$(j-@NVihJN6)yr2-(j{4;jKEOdH9O6+0*h zA^|+W_>n$x&aS?b;b*SgZW`QO*3~quuL<(zTmu&!j#BsBB~Tg9;TZJa@WR_w)IucjT>O0Z^e!E(@wE z>GI?%rgLkx1;_K((~dlbO@Ex!id@8MUX#gOjuDo=uv3|WO2X!$ET)>gfa&A>y@_x> zKyK2}MJ&rVOo4j%A^%$ag6Bt}x|VQ$^q8b9zrX}_6sSlCdo=7PJBC7-YQi#|!nbGQ z;nO5JCvg#zi%AicBo{l)P|&e8JUGXCMgStN_oYJ!eEVw)JR=d9v(CDO=eYt!T}V0 z?>Z~Elt(U9yNKzFAbpsKe&-!UhPR~&e9$Z!sAcaG8+R{#@EhiX&4DWOH+%j)GRhn& zxOP46QGC^PK_v9`q9i)`vC86r7hCi0mw48G=>nt=XMuNCs+LUaEWVy+HjSg)lnVr< z3s*RlGyabJInG6r7)hNV9g{3Zl4jJe8g4>H)H5C?oQGpfE;&~h6QW7EI#h@vF-(u| zsYEW>wHPK!uBYNE6MZQpr7wb$vG&W)&{n_~L!GMdp2V9pCJcYW0==K$DyA<{lSqyW zCFu)smfw&9>rD@=H`?dea1m)ZhC8k?g~t`W=@oAz{0y*$fka{K?eAF?X%?8=?Cd!%(Wnc63O@YnnIRRFtz?pfxsDsOvr_4_Z zgGS!eLpNHxp6QtBcFjh+OEV~h5#r=fI?L9^&*n;R03&c%Ff0o1+PPIRade9RZ;#C$ z?fw0YW&B=??Myg%S$dXF=}@69?qsmbQjB}3!#(-0RaILeZW-vi|NT>|IR_ZYjwQ1a|!mzgbGN$$MX>> zFcr)e^QJBL9+HF0SQzHt>Ah=*dYJ;C4R zhu7!Oj}uVLeJkuIz}KU&*OB1x^Wk+C`Vo6sN)(B`9E3-%fR2a)Bof9%k=V;Rc%(jL z2LTevTSbxB%QJZ7SrmyRk)lZKWfnYg1%NygN!dh^*qbGIq%QPb3D_bjlqeE=(F2b> zha!>wnJ5x_?*flZQ9z!Fqz9r%>@^5H(f~w|h+c~#v9}WN$SwqlUYZa^Vs8oHk*gGi z&$J`(1nfvX9%(>BkOZE99YDt;EtC)>fhSwGi`o`DL5xR!k0J>?0Xxu(M=n-Fo=M;d*!fyKQeIt%M8|(c*<#0C@yH)g zB!MSjr%&<72o2L=$-?fhS<+7V$_$ zEd+@iZA5L0og%~|+fgJzG{MgF;gQQAL501~p1_B&6Lxr{3M4lIB!LfM=iTtgpAaNE zk0-iL?DQEP89PPzOa}rV!p?%>ks7)PlE8?8ypx%3m{nFKzB9WlToS%yL+ zIyWKeL)hLv9y#3zK@#{7wr!3_{(>S2d$Qp From f39fc0aa2de19332fa51af605ece0660891d8c7a Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Tue, 22 Aug 2023 13:02:53 +0000 Subject: [PATCH 134/162] 8314738: Remove all occurrences of and support for @revised Reviewed-by: mr --- make/Docs.gmk | 1 - .../classes/java/io/FileInputStream.java | 2 -- .../classes/java/io/FileOutputStream.java | 2 -- .../classes/java/io/InputStreamReader.java | 2 -- .../classes/java/io/OutputStreamWriter.java | 2 -- .../classes/java/io/RandomAccessFile.java | 4 ---- .../share/classes/java/lang/Class.java | 3 --- .../share/classes/java/lang/ClassLoader.java | 19 ------------------- .../share/classes/java/lang/Package.java | 9 +-------- .../classes/java/lang/StackTraceElement.java | 6 +----- .../share/classes/java/lang/Thread.java | 4 ---- .../java/lang/invoke/MethodHandles.java | 9 --------- .../java/lang/reflect/AccessibleObject.java | 5 ----- .../classes/java/lang/reflect/Proxy.java | 5 ----- .../java/lang/reflect/package-info.java | 3 +-- .../classes/java/net/DatagramSocket.java | 6 +----- .../share/classes/java/net/ServerSocket.java | 4 ---- .../share/classes/java/net/Socket.java | 5 ----- .../classes/java/net/URLClassLoader.java | 4 +--- .../classes/java/util/ResourceBundle.java | 8 -------- .../classes/java/util/ServiceLoader.java | 9 --------- .../spi/ResourceBundleControlProvider.java | 3 +-- .../javax/lang/model/element/Element.java | 3 --- .../lang/model/element/PackageElement.java | 2 -- .../classes/javax/tools/StandardLocation.java | 4 +--- .../lang/instrument/ClassFileTransformer.java | 4 +--- .../java/lang/instrument/package-info.java | 2 -- .../java/lang/management/ThreadInfo.java | 2 -- 28 files changed, 8 insertions(+), 124 deletions(-) diff --git a/make/Docs.gmk b/make/Docs.gmk index 183318ec435..a9985ffa4d8 100644 --- a/make/Docs.gmk +++ b/make/Docs.gmk @@ -67,7 +67,6 @@ MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) ) # ordering of tags as the tags are otherwise ordered in order of definition. JAVADOC_TAGS := \ -tag beaninfo:X \ - -tag revised:X \ -tag since.unbundled:X \ -tag Note:X \ -tag ToDo:X \ diff --git a/src/java.base/share/classes/java/io/FileInputStream.java b/src/java.base/share/classes/java/io/FileInputStream.java index 2c4e8812b18..3a95f237e65 100644 --- a/src/java.base/share/classes/java/io/FileInputStream.java +++ b/src/java.base/share/classes/java/io/FileInputStream.java @@ -499,8 +499,6 @@ public int available() throws IOException { * this method should be prepared to handle possible reentrant invocation. * * @throws IOException {@inheritDoc} - * - * @revised 1.4 */ @Override public void close() throws IOException { diff --git a/src/java.base/share/classes/java/io/FileOutputStream.java b/src/java.base/share/classes/java/io/FileOutputStream.java index c596d98b3ce..90bab607f70 100644 --- a/src/java.base/share/classes/java/io/FileOutputStream.java +++ b/src/java.base/share/classes/java/io/FileOutputStream.java @@ -392,8 +392,6 @@ public void write(byte[] b, int off, int len) throws IOException { * this method should be prepared to handle possible reentrant invocation. * * @throws IOException if an I/O error occurs. - * - * @revised 1.4 */ @Override public void close() throws IOException { diff --git a/src/java.base/share/classes/java/io/InputStreamReader.java b/src/java.base/share/classes/java/io/InputStreamReader.java index 95234cc303b..b61c48ddf15 100644 --- a/src/java.base/share/classes/java/io/InputStreamReader.java +++ b/src/java.base/share/classes/java/io/InputStreamReader.java @@ -157,8 +157,6 @@ public InputStreamReader(InputStream in, CharsetDecoder dec) { * {@code null} if the stream has been closed * * @see Charset - * - * @revised 1.4 */ public String getEncoding() { return sd.getEncoding(); diff --git a/src/java.base/share/classes/java/io/OutputStreamWriter.java b/src/java.base/share/classes/java/io/OutputStreamWriter.java index bcb132e690c..b84c3b50391 100644 --- a/src/java.base/share/classes/java/io/OutputStreamWriter.java +++ b/src/java.base/share/classes/java/io/OutputStreamWriter.java @@ -176,8 +176,6 @@ public OutputStreamWriter(OutputStream out, CharsetEncoder enc) { * {@code null} if the stream has been closed * * @see Charset - * - * @revised 1.4 */ public String getEncoding() { return se.getEncoding(); diff --git a/src/java.base/share/classes/java/io/RandomAccessFile.java b/src/java.base/share/classes/java/io/RandomAccessFile.java index 0be326b0a44..7d5b17c2783 100644 --- a/src/java.base/share/classes/java/io/RandomAccessFile.java +++ b/src/java.base/share/classes/java/io/RandomAccessFile.java @@ -129,7 +129,6 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * @see java.lang.SecurityException * @see java.lang.SecurityManager#checkRead(java.lang.String) * @see java.lang.SecurityManager#checkWrite(java.lang.String) - * @revised 1.4 */ public RandomAccessFile(String name, String mode) throws FileNotFoundException @@ -215,7 +214,6 @@ public RandomAccessFile(String name, String mode) * @see java.lang.SecurityManager#checkRead(java.lang.String) * @see java.lang.SecurityManager#checkWrite(java.lang.String) * @see java.nio.channels.FileChannel#force(boolean) - * @revised 1.4 */ public RandomAccessFile(File file, String mode) throws FileNotFoundException @@ -703,8 +701,6 @@ public void setLength(long newLength) throws IOException { * this method should be prepared to handle possible reentrant invocation. * * @throws IOException if an I/O error occurs. - * - * @revised 1.4 */ public void close() throws IOException { if (closed) { diff --git a/src/java.base/share/classes/java/lang/Class.java b/src/java.base/share/classes/java/lang/Class.java index bfbe4d9ae6c..991c8bcf646 100644 --- a/src/java.base/share/classes/java/lang/Class.java +++ b/src/java.base/share/classes/java/lang/Class.java @@ -1168,7 +1168,6 @@ public Type getGenericSuperclass() { * this method returns {@code null}. * * @return the package of this class. - * @revised 9 */ public Package getPackage() { if (isPrimitive() || isArray()) { @@ -3029,7 +3028,6 @@ public Constructor getDeclaredConstructor(Class... parameterTypes) * * @see Module#getResourceAsStream(String) * @since 1.1 - * @revised 9 */ @CallerSensitive public InputStream getResourceAsStream(String name) { @@ -3125,7 +3123,6 @@ public InputStream getResourceAsStream(String name) { * manager. * @throws NullPointerException If {@code name} is {@code null} * @since 1.1 - * @revised 9 */ @CallerSensitive public URL getResource(String name) { diff --git a/src/java.base/share/classes/java/lang/ClassLoader.java b/src/java.base/share/classes/java/lang/ClassLoader.java index 079a40accde..c68681f35a2 100644 --- a/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/src/java.base/share/classes/java/lang/ClassLoader.java @@ -227,7 +227,6 @@ * @jls 13.1 The Form of a Binary * @see #resolveClass(Class) * @since 1.0 - * @revised 9 */ public abstract class ClassLoader { @@ -881,7 +880,6 @@ protected final Class defineClass(byte[] b, int off, int len) * @see java.security.SecureClassLoader * * @since 1.1 - * @revised 9 */ protected final Class defineClass(String name, byte[] b, int off, int len) throws ClassFormatError @@ -1015,8 +1013,6 @@ private void postDefineClass(Class c, ProtectionDomain pd) { * certificates than this class, or if {@code name} begins with * "{@code java.}" and this class loader is not the platform * class loader or its ancestor. - * - * @revised 9 */ protected final Class defineClass(String name, byte[] b, int off, int len, ProtectionDomain protectionDomain) @@ -1091,7 +1087,6 @@ protected final Class defineClass(String name, byte[] b, int off, int len, * @see #defineClass(String, byte[], int, int, ProtectionDomain) * * @since 1.5 - * @revised 9 */ protected final Class defineClass(String name, java.nio.ByteBuffer b, ProtectionDomain protectionDomain) @@ -1404,7 +1399,6 @@ protected URL findResource(String moduleName, String name) throws IOException { * @throws NullPointerException If {@code name} is {@code null} * * @since 1.1 - * @revised 9 */ public URL getResource(String name) { Objects.requireNonNull(name); @@ -1469,7 +1463,6 @@ public URL getResource(String name) { * @throws NullPointerException If {@code name} is {@code null} * * @since 1.2 - * @revised 9 */ public Enumeration getResources(String name) throws IOException { Objects.requireNonNull(name); @@ -1567,7 +1560,6 @@ public Stream resources(String name) { * denied by the security manager. * * @since 1.2 - * @revised 9 */ protected URL findResource(String name) { return null; @@ -1602,7 +1594,6 @@ protected URL findResource(String name) { * If I/O errors occur * * @since 1.2 - * @revised 9 */ protected Enumeration findResources(String name) throws IOException { return Collections.emptyEnumeration(); @@ -1687,7 +1678,6 @@ public final boolean isRegisteredAsParallelCapable() { * denied by the security manager. * * @since 1.1 - * @revised 9 */ public static URL getSystemResource(String name) { return getSystemClassLoader().getResource(name); @@ -1723,7 +1713,6 @@ public static URL getSystemResource(String name) { * If I/O errors occur * * @since 1.2 - * @revised 9 */ public static Enumeration getSystemResources(String name) throws IOException @@ -1755,7 +1744,6 @@ public static Enumeration getSystemResources(String name) * @throws NullPointerException If {@code name} is {@code null} * * @since 1.1 - * @revised 9 */ public InputStream getResourceAsStream(String name) { Objects.requireNonNull(name); @@ -1788,7 +1776,6 @@ public InputStream getResourceAsStream(String name) { * denied by the security manager. * * @since 1.1 - * @revised 9 */ public static InputStream getSystemResourceAsStream(String name) { URL url = getSystemResource(name); @@ -1948,9 +1935,6 @@ public static ClassLoader getPlatformClassLoader() { * exception is thrown by that constructor when it is invoked. The * underlying cause of the error can be retrieved via the * {@link Throwable#getCause()} method. - * - * @revised 1.4 - * @revised 9 */ @CallerSensitive public static ClassLoader getSystemClassLoader() { @@ -2217,7 +2201,6 @@ private Package toPackage(String name, NamedPackage p, Module m) { * * * @since 1.2 - * @revised 9 * * @jvms 5.3 Creation and Loading * @see @@ -2326,7 +2309,6 @@ public final Package[] getDefinedPackages() { * @see ClassLoader#getDefinedPackage(String) * * @since 1.2 - * @revised 9 */ @Deprecated(since="9") protected Package getPackage(String name) { @@ -2361,7 +2343,6 @@ protected Package getPackage(String name) { * @see ClassLoader#getDefinedPackages() * * @since 1.2 - * @revised 9 */ protected Package[] getPackages() { Stream pkgs = packages(); diff --git a/src/java.base/share/classes/java/lang/Package.java b/src/java.base/share/classes/java/lang/Package.java index 22a32c36894..d48320a66cf 100644 --- a/src/java.base/share/classes/java/lang/Package.java +++ b/src/java.base/share/classes/java/lang/Package.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -114,7 +114,6 @@ * @see ClassLoader#definePackage(String, String, String, String, String, String, String, URL) * * @since 1.2 - * @revised 9 */ public class Package extends NamedPackage implements java.lang.reflect.AnnotatedElement { /** @@ -211,8 +210,6 @@ public String getImplementationVersion() { * is returned if it is not known. * @return the vendor that implemented this package, {@code null} * is returned if it is not known. - * - * @revised 9 */ public String getImplementationVendor() { return versionInfo.implVendor; @@ -355,8 +352,6 @@ public boolean isCompatibleWith(String desired) * a {@code Package} for the specified class loader. * * @see ClassLoader#getDefinedPackage - * - * @revised 9 */ @CallerSensitive @Deprecated(since="9") @@ -379,8 +374,6 @@ public static Package getPackage(String name) { * class loader and its ancestors * * @see ClassLoader#getDefinedPackages - * - * @revised 9 */ @CallerSensitive public static Package[] getPackages() { diff --git a/src/java.base/share/classes/java/lang/StackTraceElement.java b/src/java.base/share/classes/java/lang/StackTraceElement.java index 9b87d2ae7cd..ed8d47a4e50 100644 --- a/src/java.base/share/classes/java/lang/StackTraceElement.java +++ b/src/java.base/share/classes/java/lang/StackTraceElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -118,7 +118,6 @@ public final class StackTraceElement implements java.io.Serializable { * @throws NullPointerException if {@code declaringClass} or * {@code methodName} is null * @since 1.5 - * @revised 9 */ public StackTraceElement(String declaringClass, String methodName, String fileName, int lineNumber) { @@ -355,7 +354,6 @@ public boolean isNativeMethod() { * {@link java.lang.StackWalker.StackFrame}, where an implementation may * choose to omit some element in the returned string. * - * @revised 9 * @see Throwable#printStackTrace() */ @Override @@ -426,8 +424,6 @@ private static int length(String s) { * @return true if the specified object is another * {@code StackTraceElement} instance representing the same * execution point as this instance. - * - * @revised 9 */ public boolean equals(Object obj) { if (obj==this) diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java index dc6a989f3ef..199a6be6023 100644 --- a/src/java.base/share/classes/java/lang/Thread.java +++ b/src/java.base/share/classes/java/lang/Thread.java @@ -1693,8 +1693,6 @@ public final void stop() { * * @throws SecurityException * if the current thread cannot modify this thread - * - * @revised 6.0, 14 */ public void interrupt() { if (this != Thread.currentThread()) { @@ -1726,7 +1724,6 @@ public void interrupt() { * @return {@code true} if the current thread has been interrupted; * {@code false} otherwise. * @see #isInterrupted() - * @revised 6.0, 14 */ public static boolean interrupted() { return currentThread().getAndClearInterrupt(); @@ -1739,7 +1736,6 @@ public static boolean interrupted() { * @return {@code true} if this thread has been interrupted; * {@code false} otherwise. * @see #interrupted() - * @revised 6.0, 14 */ public boolean isInterrupted() { return interrupted; diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 3e61b179e7c..c55f08564ae 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -175,8 +175,6 @@ private static Lookup lookup(Class caller) { * Also, it cannot access * caller sensitive methods. * @return a lookup object which is trusted minimally - * - * @revised 9 */ public static Lookup publicLookup() { return Lookup.PUBLIC_LOOKUP; @@ -1437,8 +1435,6 @@ public static T reflectAs(Class expected, MethodHandle tar * so that there can be a secure foundation for lookups. * Nearly all other methods in the JSR 292 API rely on lookup * objects to check access requests. - * - * @revised 9 */ public static final class Lookup { @@ -1621,8 +1617,6 @@ private Class lookupClassOrNull() { * @return the lookup modes, which limit the kinds of access performed by this lookup object * @see #in * @see #dropLookupMode - * - * @revised 9 */ public int lookupModes() { return allowedModes & ALL_MODES; @@ -1703,7 +1697,6 @@ private static Lookup newLookup(Class lookupClass, Class prevLookupClass, * @throws IllegalArgumentException if {@code requestedLookupClass} is a primitive type or void or array class * @throws NullPointerException if the argument is null * - * @revised 9 * @see #accessClass(Class) * @see Cross-module lookups */ @@ -2599,8 +2592,6 @@ private static void checkUnprivilegedlookupClass(Class lookupClass) { * because it requires a direct subclass relationship between * caller and callee.) * @see #in - * - * @revised 9 */ @Override public String toString() { diff --git a/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java b/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java index 1b1c2924e4f..d0b50047031 100644 --- a/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java +++ b/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java @@ -74,7 +74,6 @@ * @spec jni/index.html Java Native Interface Specification * @jls 6.6 Access Control * @since 1.2 - * @revised 9 */ public class AccessibleObject implements AnnotatedElement { static { @@ -119,7 +118,6 @@ static void checkPermission() { * java.lang.Class} * @see SecurityManager#checkPermission * @see ReflectPermission - * @revised 9 */ @CallerSensitive public static void setAccessible(AccessibleObject[] array, boolean flag) { @@ -207,7 +205,6 @@ public static void setAccessible(AccessibleObject[] array, boolean flag) { * @spec jni/index.html Java Native Interface Specification * @see #trySetAccessible * @see java.lang.invoke.MethodHandles#privateLookupIn - * @revised 9 */ @CallerSensitive // overrides in Method/Field/Constructor are @CS public void setAccessible(boolean flag) { @@ -424,8 +421,6 @@ String toShortString() { * This method may return {@code false} on a reflected object that is * accessible to the caller. To test if this reflected object is accessible, * it should use {@link #canAccess(Object)}. - * - * @revised 9 */ @Deprecated(since="9") public boolean isAccessible() { diff --git a/src/java.base/share/classes/java/lang/reflect/Proxy.java b/src/java.base/share/classes/java/lang/reflect/Proxy.java index a638c6ef537..3c37153b875 100644 --- a/src/java.base/share/classes/java/lang/reflect/Proxy.java +++ b/src/java.base/share/classes/java/lang/reflect/Proxy.java @@ -292,7 +292,6 @@ * @author Peter Jones * @see InvocationHandler * @since 1.3 - * @revised 9 */ public class Proxy implements java.io.Serializable { @java.io.Serial @@ -382,7 +381,6 @@ protected Proxy(InvocationHandler h) { * to create a proxy instance instead. * * @see Package and Module Membership of Proxy Class - * @revised 9 */ @Deprecated @CallerSensitive @@ -1015,7 +1013,6 @@ private static Module getDynamicModule(ClassLoader loader) { * {@code null} * * @see Package and Module Membership of Proxy Class - * @revised 9 */ @CallerSensitive public static Object newProxyInstance(ClassLoader loader, @@ -1100,8 +1097,6 @@ private static ClassLoader getLoader(Module m) { * @return {@code true} if the class is a proxy class and * {@code false} otherwise * @throws NullPointerException if {@code cl} is {@code null} - * - * @revised 9 */ public static boolean isProxyClass(Class cl) { return Proxy.class.isAssignableFrom(cl) && ProxyBuilder.isProxyClass(cl); diff --git a/src/java.base/share/classes/java/lang/reflect/package-info.java b/src/java.base/share/classes/java/lang/reflect/package-info.java index bdf42ee7e8c..a71eb2d9621 100644 --- a/src/java.base/share/classes/java/lang/reflect/package-info.java +++ b/src/java.base/share/classes/java/lang/reflect/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,6 +94,5 @@ * @jvms 5.3.1 Loading Using the Bootstrap Class Loader * @jvms 5.3.2 Loading Using a User-defined Class Loader * @since 1.1 - * @revised 9 */ package java.lang.reflect; diff --git a/src/java.base/share/classes/java/net/DatagramSocket.java b/src/java.base/share/classes/java/net/DatagramSocket.java index 9a104349e4a..26220feac2c 100644 --- a/src/java.base/share/classes/java/net/DatagramSocket.java +++ b/src/java.base/share/classes/java/net/DatagramSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -656,7 +656,6 @@ public SocketAddress getLocalSocketAddress() { * @see java.net.DatagramPacket * @see SecurityManager#checkMulticast(InetAddress) * @see SecurityManager#checkConnect - * @revised 1.4 */ public void send(DatagramPacket p) throws IOException { delegate().send(p); @@ -708,7 +707,6 @@ public void send(DatagramPacket p) throws IOException { * and the channel is in non-blocking mode. * @see java.net.DatagramPacket * @see java.net.DatagramSocket - * @revised 1.4 */ public void receive(DatagramPacket p) throws IOException { delegate().receive(p); @@ -1082,8 +1080,6 @@ public int getTrafficClass() throws SocketException { * *

    If this socket has an associated channel then the channel is closed * as well. - * - * @revised 1.4 */ public void close() { delegate().close(); diff --git a/src/java.base/share/classes/java/net/ServerSocket.java b/src/java.base/share/classes/java/net/ServerSocket.java index e3aa92a846b..6e38ed4447d 100644 --- a/src/java.base/share/classes/java/net/ServerSocket.java +++ b/src/java.base/share/classes/java/net/ServerSocket.java @@ -125,7 +125,6 @@ private static Void checkPermission() { * Creates an unbound server socket. * * @throws IOException IO error when opening the socket. - * @revised 1.4 */ public ServerSocket() throws IOException { this.impl = createImpl(); @@ -532,7 +531,6 @@ public SocketAddress getLocalSocketAddress() { * * @return the new Socket * @see SecurityManager#checkAccept - * @revised 1.4 */ public Socket accept() throws IOException { if (isClosed()) @@ -575,7 +573,6 @@ public Socket accept() throws IOException { * to accept a connection with the given socket * * @since 1.1 - * @revised 1.4 */ protected final void implAccept(Socket s) throws IOException { SocketImpl si = s.impl(); @@ -741,7 +738,6 @@ private void ensureCompatible(SocketImpl si) throws IOException { * as well. * * @throws IOException if an I/O error occurs when closing the socket. - * @revised 1.4 */ public void close() throws IOException { synchronized (socketLock) { diff --git a/src/java.base/share/classes/java/net/Socket.java b/src/java.base/share/classes/java/net/Socket.java index bd65f634363..82a7a42badf 100644 --- a/src/java.base/share/classes/java/net/Socket.java +++ b/src/java.base/share/classes/java/net/Socket.java @@ -176,7 +176,6 @@ private Socket(Void unused, SocketImpl impl) { * socket implementation is created. * * @since 1.1 - * @revised 1.4 */ public Socket() { this.impl = createImpl(); @@ -1051,8 +1050,6 @@ public SocketChannel getChannel() { * input stream, the socket is closed, the socket is * not connected, or the socket input has been shutdown * using {@link #shutdownInput()} - * - * @revised 1.4 */ public InputStream getInputStream() throws IOException { int s = state; @@ -1149,7 +1146,6 @@ public void close() throws IOException { * @return an output stream for writing bytes to this socket. * @throws IOException if an I/O error occurs when creating the * output stream or if the socket is not connected. - * @revised 1.4 */ public OutputStream getOutputStream() throws IOException { int s = state; @@ -1717,7 +1713,6 @@ public boolean getReuseAddress() throws SocketException { * as well. * * @throws IOException if an I/O error occurs when closing this socket. - * @revised 1.4 * @see #isClosed */ public void close() throws IOException { diff --git a/src/java.base/share/classes/java/net/URLClassLoader.java b/src/java.base/share/classes/java/net/URLClassLoader.java index 97c95bc9f59..724ead583e4 100644 --- a/src/java.base/share/classes/java/net/URLClassLoader.java +++ b/src/java.base/share/classes/java/net/URLClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -539,8 +539,6 @@ private Class defineClass(String name, Resource res) throws IOException { * @throws IllegalArgumentException if the package name is * already defined by this class loader * @return the newly defined {@code Package} object - * - * @revised 9 */ protected Package definePackage(String name, Manifest man, URL url) { String specTitle = null, specVersion = null, specVendor = null; diff --git a/src/java.base/share/classes/java/util/ResourceBundle.java b/src/java.base/share/classes/java/util/ResourceBundle.java index 147f098aac9..026a9b80820 100644 --- a/src/java.base/share/classes/java/util/ResourceBundle.java +++ b/src/java.base/share/classes/java/util/ResourceBundle.java @@ -373,7 +373,6 @@ * @see MissingResourceException * @see ResourceBundleProvider * @since 1.1 - * @revised 9 */ public abstract class ResourceBundle { @@ -894,7 +893,6 @@ public static final ResourceBundle getBundle(String baseName) * @throws UnsupportedOperationException * if this method is called in a named module * @since 1.6 - * @revised 9 */ @CallerSensitive public static final ResourceBundle getBundle(String baseName, @@ -1054,7 +1052,6 @@ public static ResourceBundle getBundle(String baseName, Locale targetLocale, Mod * @throws UnsupportedOperationException * if this method is called in a named module * @since 1.6 - * @revised 9 */ @CallerSensitive public static final ResourceBundle getBundle(String baseName, Locale targetLocale, @@ -1267,7 +1264,6 @@ public static final ResourceBundle getBundle(String baseName, Locale targetLocal * @throws MissingResourceException * if no resource bundle for the specified base name can be found * @since 1.2 - * @revised 9 * @see Resource Bundles and Named Modules */ @CallerSensitive @@ -1492,7 +1488,6 @@ public static ResourceBundle getBundle(String baseName, Locale locale, * @throws UnsupportedOperationException * if this method is called in a named module * @since 1.6 - * @revised 9 */ @CallerSensitive public static ResourceBundle getBundle(String baseName, Locale targetLocale, @@ -2235,7 +2230,6 @@ private static void setExpirationTime(CacheKey cacheKey, Control control) { * by the caller's module. * * @since 1.6 - * @revised 9 * @see ResourceBundle.Control#getTimeToLive(String,Locale) */ @CallerSensitive @@ -2524,7 +2518,6 @@ protected Set handleKeySet() { * of {@link ResourceBundleControlProvider} are ignored in named modules. * * @since 1.6 - * @revised 9 * @see java.util.spi.ResourceBundleProvider */ public static class Control { @@ -3150,7 +3143,6 @@ public Locale getFallbackLocale(String baseName, Locale locale) { * if an error occurred when reading resources using * any I/O operations * @see java.util.spi.ResourceBundleProvider#getBundle(String, Locale) - * @revised 9 */ public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) diff --git a/src/java.base/share/classes/java/util/ServiceLoader.java b/src/java.base/share/classes/java/util/ServiceLoader.java index e1db8188162..d4858e7582a 100644 --- a/src/java.base/share/classes/java/util/ServiceLoader.java +++ b/src/java.base/share/classes/java/util/ServiceLoader.java @@ -386,7 +386,6 @@ * * @author Mark Reinhold * @since 1.6 - * @revised 9 */ public final class ServiceLoader @@ -1355,8 +1354,6 @@ public Provider next() { * * @return An iterator that lazily loads providers for this loader's * service - * - * @revised 9 */ public Iterator iterator() { @@ -1640,8 +1637,6 @@ static ServiceLoader load(Class service, * if the service type is not accessible to the caller or the * caller is in an explicit module and its module descriptor does * not declare that it uses {@code service} - * - * @revised 9 */ @CallerSensitive @SuppressWarnings("doclint:reference") // cross-module links @@ -1686,8 +1681,6 @@ public static ServiceLoader load(Class service, * if the service type is not accessible to the caller or the * caller is in an explicit module and its module descriptor does * not declare that it uses {@code service} - * - * @revised 9 */ @CallerSensitive public static ServiceLoader load(Class service) { @@ -1721,8 +1714,6 @@ public static ServiceLoader load(Class service) { * if the service type is not accessible to the caller or the * caller is in an explicit module and its module descriptor does * not declare that it uses {@code service} - * - * @revised 9 */ @CallerSensitive public static ServiceLoader loadInstalled(Class service) { diff --git a/src/java.base/share/classes/java/util/spi/ResourceBundleControlProvider.java b/src/java.base/share/classes/java/util/spi/ResourceBundleControlProvider.java index 30e0225f531..fc9a3960e7e 100644 --- a/src/java.base/share/classes/java/util/spi/ResourceBundleControlProvider.java +++ b/src/java.base/share/classes/java/util/spi/ResourceBundleControlProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,6 @@ * * @author Masayoshi Okutsu * @since 1.8 - * @revised 9 * @see ResourceBundle#getBundle(String, java.util.Locale, ClassLoader, ResourceBundle.Control) * ResourceBundle.getBundle * @see java.util.ServiceLoader#load(Class) diff --git a/src/java.compiler/share/classes/javax/lang/model/element/Element.java b/src/java.compiler/share/classes/javax/lang/model/element/Element.java index 473e428d9ad..150be74c7e1 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/Element.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/Element.java @@ -153,7 +153,6 @@ public interface Element extends AnnotatedConstruct { * @see VariableElement#getSimpleName * @see ModuleElement#getSimpleName * @see RecordComponentElement#getSimpleName - * @revised 9 */ Name getSimpleName(); @@ -194,7 +193,6 @@ public interface Element extends AnnotatedConstruct { * * @return the enclosing element, or {@code null} if there is none * @see Elements#getPackageOf - * @revised 9 */ Element getEnclosingElement(); @@ -231,7 +229,6 @@ public interface Element extends AnnotatedConstruct { * @jls 8.8.9 Default Constructor * @jls 8.9 Enum Classes * @jls 8.10 Record Classes - * @revised 9 */ List getEnclosedElements(); diff --git a/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java b/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java index fd373436b33..651bbe70eee 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java @@ -127,8 +127,6 @@ public interface PackageElement extends Element, QualifiedNameable { * processing environment configured for a {@linkplain * javax.annotation.processing.ProcessingEnvironment#getSourceVersion * source version} without modules. - * - * @revised 9 */ @Override Element getEnclosingElement(); diff --git a/src/java.compiler/share/classes/javax/tools/StandardLocation.java b/src/java.compiler/share/classes/javax/tools/StandardLocation.java index 2a9079f5724..389f3410f4e 100644 --- a/src/java.compiler/share/classes/javax/tools/StandardLocation.java +++ b/src/java.compiler/share/classes/javax/tools/StandardLocation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -120,8 +120,6 @@ public enum StandardLocation implements Location { * * @param name a name * @return a location - * - * @revised 9 */ public static Location locationFor(final String name) { if (locations.isEmpty()) { diff --git a/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java b/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java index 6df7a2ae697..d4c17f1cfdc 100644 --- a/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java +++ b/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -190,8 +190,6 @@ public interface ClassFileTransformer { * if the input does not represent a well-formed class file * @return a well-formed class file buffer (the result of the transform), * or {@code null} if no transform is performed - * - * @revised 9 */ default byte[] transform( ClassLoader loader, diff --git a/src/java.instrument/share/classes/java/lang/instrument/package-info.java b/src/java.instrument/share/classes/java/lang/instrument/package-info.java index 4219d51f05f..fe0ffc91a06 100644 --- a/src/java.instrument/share/classes/java/lang/instrument/package-info.java +++ b/src/java.instrument/share/classes/java/lang/instrument/package-info.java @@ -327,8 +327,6 @@ * transformed classes to read the unnamed module of both class loaders. * * @since 1.5 - * @revised 1.6 - * @revised 9 */ package java.lang.instrument; diff --git a/src/java.management/share/classes/java/lang/management/ThreadInfo.java b/src/java.management/share/classes/java/lang/management/ThreadInfo.java index 9701e1ae0d8..18c29d90e92 100644 --- a/src/java.management/share/classes/java/lang/management/ThreadInfo.java +++ b/src/java.management/share/classes/java/lang/management/ThreadInfo.java @@ -885,8 +885,6 @@ public String toString() { * @return a {@code ThreadInfo} object represented * by {@code cd} if {@code cd} is not {@code null}; * {@code null} otherwise. - * - * @revised 9 */ public static ThreadInfo from(CompositeData cd) { if (cd == null) { From 69d900d2ce97e5479020cff9a63c471d07e39989 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 22 Aug 2023 13:37:21 +0000 Subject: [PATCH 135/162] 8314730: GHA: Drop libfreetype6-dev transitional package in favor of libfreetype-dev Reviewed-by: andrew, erikj --- .github/workflows/build-cross-compile.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index 441b4b43192..95f871b5b37 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -137,7 +137,7 @@ jobs: sudo debootstrap --arch=${{ matrix.debian-arch }} --verbose - --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev + --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev --resolve-deps --variant=minbase $(test -n "${{ matrix.debian-keyring }}" && echo "--keyring=${{ matrix.debian-keyring }}") diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f003864ef4c..64b5cae0451 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -148,7 +148,7 @@ jobs: apt-architecture: 'i386' # Some multilib libraries do not have proper inter-dependencies, so we have to # install their dependencies manually. - apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386 libgcc-s1:i386 libstdc++6:i386' + apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386 libgcc-s1:i386 libstdc++6:i386' extra-conf-options: '--with-target-bits=32' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} From 20e94784c9f7c30e95550c72aedb5e986a153114 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 22 Aug 2023 14:00:47 +0000 Subject: [PATCH 136/162] 8314426: runtime/os/TestTrimNative.java is failing on slow machines Reviewed-by: mbaesken, mdoerr, shade --- test/hotspot/jtreg/runtime/os/TestTrimNative.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/runtime/os/TestTrimNative.java b/test/hotspot/jtreg/runtime/os/TestTrimNative.java index 5fa87ea903f..f1aed48b88e 100644 --- a/test/hotspot/jtreg/runtime/os/TestTrimNative.java +++ b/test/hotspot/jtreg/runtime/os/TestTrimNative.java @@ -170,7 +170,6 @@ private static void checkExpectedLogMessages(OutputAnalyzer output, boolean expe if (expectEnabled) { output.shouldContain("Periodic native trim enabled (interval: " + expectedInterval + " ms"); output.shouldContain("Native heap trimmer start"); - output.shouldContain("Native heap trimmer stop"); } else { output.shouldNotContain("Periodic native trim enabled"); } @@ -251,7 +250,7 @@ public static void main(String[] args) throws Exception { System.gc(); // give GC time to react - System.out.println("Sleeping..."); + System.out.println("Sleeping for " + sleeptime + " ms..."); Thread.sleep(sleeptime); System.out.println("Done."); } @@ -296,12 +295,15 @@ public static void main(String[] args) throws Exception { case "trimNativeLowInterval": case "trimNativeLowIntervalStrict": { + long ms1 = System.currentTimeMillis(); OutputAnalyzer output = runTestWithOptions( new String[] { "-XX:+UnlockExperimentalVMOptions", "-XX:TrimNativeHeapInterval=1" }, new String[] { TestTrimNative.Tester.class.getName(), "0" } ); + long ms2 = System.currentTimeMillis(); + int maxTrimsExpected = (int)(ms2 - ms1); // 1ms trim interval checkExpectedLogMessages(output, true, 1); - parseOutputAndLookForNegativeTrim(output, 1, 3000, strictTesting); + parseOutputAndLookForNegativeTrim(output, 1, (int)maxTrimsExpected, strictTesting); } break; case "testOffOnNonCompliantPlatforms": { From eb065726f2b489c9f0f7d76ea75a2eb4d60347b7 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Tue, 22 Aug 2023 17:14:29 +0000 Subject: [PATCH 137/162] 8313408: Use SVG for BoxLayout example Reviewed-by: serb, tr, prr --- .../share/classes/javax/swing/BoxLayout.java | 6 +- .../javax/swing/doc-files/BoxLayout-1.gif | Bin 1779 -> 0 bytes .../javax/swing/doc-files/BoxLayout-1.svg | 74 ++++++++++++++++++ 3 files changed, 77 insertions(+), 3 deletions(-) delete mode 100644 src/java.desktop/share/classes/javax/swing/doc-files/BoxLayout-1.gif create mode 100644 src/java.desktop/share/classes/javax/swing/doc-files/BoxLayout-1.svg diff --git a/src/java.desktop/share/classes/javax/swing/BoxLayout.java b/src/java.desktop/share/classes/javax/swing/BoxLayout.java index fe11a08bc64..cbc2bbd3092 100644 --- a/src/java.desktop/share/classes/javax/swing/BoxLayout.java +++ b/src/java.desktop/share/classes/javax/swing/BoxLayout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,9 +38,9 @@ * arranged when the frame is resized. *

    *

    Example: - *

    The following text describes this graphic. + * width="160" height="160"> *

    *

    * Nesting multiple panels with different combinations of horizontal and diff --git a/src/java.desktop/share/classes/javax/swing/doc-files/BoxLayout-1.gif b/src/java.desktop/share/classes/javax/swing/doc-files/BoxLayout-1.gif deleted file mode 100644 index 8493ab8ec14bd62e32eb9ee72a022f3c368b0240..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1779 zcmVM)j$~<`XsWJk>%MR- z&vb3yc&_h!@BhG{a7Zi~kI1BQ$!w|s(5Q4uty-_xtai)odcR;P2;eLO$se?Nty6d0 z>^Kd+q08?sdq$7%qxctqeuE-{6^4X~9EcN)iWXIkQDu$~m6lW#P;8r$m=c{#m6xHP zVr!+CovBHqA*rjEL9lMDNUmdWv7EKNlw+^Hpt5I~p1*0qQ<}s-wx4FWX?)L0w$-h` zxqHn%*WEqR9@W^lcE+OG)7+1o>h17v@A32);`R8N^ZEJr{P_Nug&9b2*}pye^hFz2 zuwj^22^*mrhb);zdlTh3Ar%o+#zp=WDP9cpu}(;hA~7yRnXV&AgeyUAgg6pXNe$p~ zaIAUgCd?)~Q@%X;vn5ZQNb5NCBD1Mcp-yd@v|)%5pruTw9xW<0X^pB-ds2-`*6UEN zGQhIzI;X5zw;r{&mHSrgSGX#}Dy$nrE#90i<8IA+mhcR}bnVXN%h<4D$9?hcEu2;| z+rO4qAZ~2w#^%ft(O#~c7;@;lr8$qDZ2HCL)}63w_~kwIo_DbE&u z`t~tXlY*}%Zrh%kQptxm2R)rN^W(aqS+=U0*06Hbc}o{x9Cr3V+{cGse;!hF)v*U( ze~p`+a`MaBYp)MJzVZC?ZT?41dhoF)$T#i%7u0?F`RAN{+wG>`H@U&LAZFuvx1WU) zI_O?~*eOU;hxCD{U4I?|Xx)k?YM9}O45o-5ZttO3;*7pkn4ozw{>Ng2fXUaOfu2z} zWO*|lnZk`f_Lzr}P6Egz3sVv)TY*hV38e{DIvHe#N``sWmL+sK=9NBXi6faLn2F_* zPzHpgid2GjCTeer$sw9NT8U?xbN0sO2yO!UN1QHo38#8q7RhL!uvLW>7k1`(f}(mF zItz)DZh@$LUphKy8!%!>RG&gzI9#ZFYU)j?tNMiMrh%;))1zm=${DMFTKa0OO-kBn z7M0EfETmB;t68zm{tb)8rzDQ5Ym&(Fx~Gt~`dTKl*R_DDveimkD}mkCi7U8%y1Ff+ zcP^%>oIr}2X1j+$8{@ZJa!cp3=faz;wIbdt@2r{f2(ZD?wz{vH!HSD5xeG69slQeJ zrenaS;&ci+*Mga?g3pn$ON0U|YANKt4 zw2?}Njg9&yNg>hwCMxuRKgaxF&;5N%@zPIw46)HUlZV*wChPWc$6#|^pg|mC%(ha|U5xOt=@NWt(F{Lf_TB2X33$rpPOS8~`Le66;Yow) zu+<6oS}wKzau-hM;VL(-xa5qli>25wNWJ*un>(&~A%pKaIoMYRF7dmkuMRZgeUtWi z<+hK@d%cnWj-InuaK7^2!8;8Ur^H*)x}dkBPAcClpL%(!w`&=F?*ki2dNy%mPyP3| zcsvBn&|6=#GueNE==L< zP(?m(Jx_t7%Z=XX6uS}5P=q$);TzKSw!OuWMxofD5Fu!{s*!CXF(NH!R5)N%` ziy;0Eov4Zg`Y?#pk`y<5W4x@5t%6K6qRh}^!t`-*W>Ng&%4+y8Gd9tUY;=#v$Y{kA zTF7g_Y2g)p7RV~@PJ{bO;vRRj#3LqXV|+ZMBX_35uc^_G5ZXi$FX=rkmadFL%$p@S zi7PtduaSd%p(Il&!$YZ#f1;xu=sftqNhVH~!dqYeXh=&m$}e}ij3qBw=t)DFvU>}o zBfnOONmv$eg3e?hE)m&E>x4kxJBSGbDMeupb|%@Ou=ch zoKM-6I)5`wTNWXX_p~4|tzka#{c?rxd!4)B2hezq^OI@(Ci@7w(0{h`eEp1HM6L_E z1bh;~i`r9PHGk#MUZOCVJiw^?42n&i=#!%SWGF```cQu^aC#j*s48D-(u9IE920FQ zOFe42lHx$5`y;7BLweGy%+py6IVx6)dXRtktEq{2DpUs{)v5NOs#d)NReIDCRIP3WUrys%zG*1+u6WIB7wF2@zWVjAfDNo*2TRz( V8uqY=O{`)U%h<*`)~XQz06X>qj>Z50 diff --git a/src/java.desktop/share/classes/javax/swing/doc-files/BoxLayout-1.svg b/src/java.desktop/share/classes/javax/swing/doc-files/BoxLayout-1.svg new file mode 100644 index 00000000000..84235395ae6 --- /dev/null +++ b/src/java.desktop/share/classes/javax/swing/doc-files/BoxLayout-1.svg @@ -0,0 +1,74 @@ + + + + + + + + + P1 + + + + + + + + + C1 + C2 + C3 + + + P2 + C4 + C5 + C6 + + From 32bf468c3b9c39550bca4e9aba31252cf08303ea Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 22 Aug 2023 17:21:44 +0000 Subject: [PATCH 138/162] 8314274: G1: Fix -Wconversion warnings around G1CardSetArray::_data Reviewed-by: kbarrett, tschatzl --- src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp index 15f69e68cf2..c908254a555 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp @@ -144,7 +144,7 @@ inline G1CardSetArray::G1CardSetArray(uint card_in_region, EntryCountType num_ca _num_entries(1) { assert(_size > 0, "CardSetArray of size 0 not supported."); assert(_size < LockBitMask, "Only support CardSetArray of size %u or smaller.", LockBitMask - 1); - _data[0] = card_in_region; + _data[0] = checked_cast(card_in_region); } inline G1CardSetArray::G1CardSetArrayLocker::G1CardSetArrayLocker(EntryCountType volatile* num_entries_addr) : @@ -195,7 +195,7 @@ inline G1AddCardResult G1CardSetArray::add(uint card_idx) { return Overflow; } - _data[num_entries] = card_idx; + _data[num_entries] = checked_cast(card_idx); x.inc_num_entries(); From ce1ded1a4f36b55717793f2bed4a64ce0353fc34 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 22 Aug 2023 17:23:37 +0000 Subject: [PATCH 139/162] 8314749: Remove unimplemented _Copy_conjoint_oops_atomic Reviewed-by: dcubed --- src/hotspot/share/utilities/copy.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hotspot/share/utilities/copy.hpp b/src/hotspot/share/utilities/copy.hpp index c16a62729b1..3c2756169ae 100644 --- a/src/hotspot/share/utilities/copy.hpp +++ b/src/hotspot/share/utilities/copy.hpp @@ -41,7 +41,6 @@ extern "C" { void _Copy_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count); void _Copy_conjoint_jints_atomic (const jint* from, jint* to, size_t count); void _Copy_conjoint_jlongs_atomic (const jlong* from, jlong* to, size_t count); - void _Copy_conjoint_oops_atomic (const oop* from, oop* to, size_t count); void _Copy_arrayof_conjoint_bytes (const HeapWord* from, HeapWord* to, size_t count); void _Copy_arrayof_conjoint_jshorts(const HeapWord* from, HeapWord* to, size_t count); From 2eae13c669d8ec383b8303079a06abd7aa2b1c7f Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 22 Aug 2023 19:04:46 +0000 Subject: [PATCH 140/162] 8214248: (fs) Files:mismatch spec clarifications Reviewed-by: alanb --- src/java.base/share/classes/java/nio/file/Files.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java.base/share/classes/java/nio/file/Files.java b/src/java.base/share/classes/java/nio/file/Files.java index 2ff8819af10..444a22bc0a4 100644 --- a/src/java.base/share/classes/java/nio/file/Files.java +++ b/src/java.base/share/classes/java/nio/file/Files.java @@ -1531,7 +1531,8 @@ public static FileStore getFileStore(Path path) throws IOException { * @throws SecurityException * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to both files. + * method is invoked to check read access to both files when the + * two paths are not equal * * @see java.nio.file.attribute.BasicFileAttributes#fileKey */ @@ -1571,6 +1572,9 @@ public static boolean isSameFile(Path path, Path path2) throws IOException { * and {@code g}, {@code mismatch(f,g)} will return the same value as * {@code mismatch(g,f)}). * + *

    If both {@code Path} objects are equal, then this method returns + * {@code true} without checking if the file exists. + * * @param path * the path to the first file * @param path2 @@ -1583,7 +1587,8 @@ public static boolean isSameFile(Path path, Path path2) throws IOException { * @throws SecurityException * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to both files. + * method is invoked to check read access to both files when the + * two paths are not equal * * @since 12 */ From 7c169a426f93a9c5f1223eddeb9ce0427722c8ab Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Tue, 22 Aug 2023 20:57:11 +0000 Subject: [PATCH 141/162] 8312232: Remove sun.jvm.hotspot.runtime.VM.buildLongFromIntsPD() Reviewed-by: lmesnik, kevinw --- .../jvm/hotspot/runtime/StackValueCollection.java | 5 +---- .../share/classes/sun/jvm/hotspot/runtime/VM.java | 12 +----------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java index 7769bb1669b..566b527b88a 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,8 +47,6 @@ public class StackValueCollection { public char charAt(int slot) { return (char) get(slot).getInteger(); } public short shortAt(int slot) { return (short) get(slot).getInteger(); } public int intAt(int slot) { return (int) get(slot).getInteger(); } - public long longAt(int slot) { return VM.getVM().buildLongFromIntsPD((int) get(slot).getInteger(), - (int) get(slot+1).getInteger()); } public OopHandle oopHandleAt(int slot) { StackValue sv = get(slot); @@ -59,5 +57,4 @@ public OopHandle oopHandleAt(int slot) { } public float floatAt(int slot) { return Float.intBitsToFloat(intAt(slot)); } - public double doubleAt(int slot) { return Double.longBitsToDouble(longAt(slot)); } } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java index 8a5d704dec0..232f3e864a3 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -727,16 +727,6 @@ public int buildIntFromShorts(short low, short high) { return (((int) high) << 16) | (((int) low) & 0xFFFF); } - /** Utility routine for building a long from two "unsigned" 32-bit - ints in platform-dependent order */ - public long buildLongFromIntsPD(int oneHalf, int otherHalf) { - if (isBigEndian) { - return (((long) otherHalf) << 32) | (((long) oneHalf) & 0x00000000FFFFFFFFL); - } else{ - return (((long) oneHalf) << 32) | (((long) otherHalf) & 0x00000000FFFFFFFFL); - } - } - public TypeDataBase getTypeDataBase() { return db; } From 9f4a9fe488be7ce43f6719c54df25a1fabd8696a Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Tue, 22 Aug 2023 22:37:16 +0000 Subject: [PATCH 142/162] 8312434: SPECjvm2008/xml.transform with CDS fails with "can't seal package nu.xom" Reviewed-by: iklam, matsaave --- src/hotspot/share/cds/filemap.cpp | 45 +++--------- src/hotspot/share/cds/filemap.hpp | 5 -- .../jtreg/runtime/cds/appcds/JarBuilder.java | 29 ++++++-- .../runtime/cds/appcds/SealingViolation.java | 73 +++++++++++++++++++ .../jtreg/runtime/cds/appcds/SignedJar.java | 2 +- .../appcds/test-classes/pkg/package_seal.mf | 6 ++ 6 files changed, 111 insertions(+), 49 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/SealingViolation.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/test-classes/pkg/package_seal.mf diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 7a05c3069db..411d1b03a00 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -354,7 +354,7 @@ void SharedClassPathEntry::copy_from(SharedClassPathEntry* ent, ClassLoaderData* _from_class_path_attr = ent->_from_class_path_attr; set_name(ent->name(), CHECK); - if (ent->is_jar() && !ent->is_signed() && ent->manifest() != nullptr) { + if (ent->is_jar() && ent->manifest() != nullptr) { Array* buf = MetadataFactory::new_array(loader_data, ent->manifest_size(), CHECK); @@ -608,29 +608,6 @@ class ManifestStream: public ResourceObj { buf[len] = 0; return buf; } - - // The return value indicates if the JAR is signed or not - bool check_is_signed() { - u1* attr = _current; - bool isSigned = false; - while (_current < _buffer_end) { - if (*_current == '\n') { - *_current = '\0'; - u1* value = (u1*)strchr((char*)attr, ':'); - if (value != nullptr) { - assert(*(value+1) == ' ', "Unrecognized format" ); - if (strstr((char*)attr, "-Digest") != nullptr) { - isSigned = true; - break; - } - } - *_current = '\n'; // restore - attr = _current + 1; - } - _current ++; - } - return isSigned; - } }; void FileMapInfo::update_jar_manifest(ClassPathEntry *cpe, SharedClassPathEntry* ent, TRAPS) { @@ -643,18 +620,14 @@ void FileMapInfo::update_jar_manifest(ClassPathEntry *cpe, SharedClassPathEntry* if (manifest != nullptr) { ManifestStream* stream = new ManifestStream((u1*)manifest, manifest_size); - if (stream->check_is_signed()) { - ent->set_is_signed(); - } else { - // Copy the manifest into the shared archive - manifest = ClassLoaderExt::read_raw_manifest(THREAD, cpe, &manifest_size); - Array* buf = MetadataFactory::new_array(loader_data, - manifest_size, - CHECK); - char* p = (char*)(buf->data()); - memcpy(p, manifest, manifest_size); - ent->set_manifest(buf); - } + // Copy the manifest into the shared archive + manifest = ClassLoaderExt::read_raw_manifest(THREAD, cpe, &manifest_size); + Array* buf = MetadataFactory::new_array(loader_data, + manifest_size, + CHECK); + char* p = (char*)(buf->data()); + memcpy(p, manifest, manifest_size); + ent->set_manifest(buf); } } diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp index 784a2cc6980..963a7011df2 100644 --- a/src/hotspot/share/cds/filemap.hpp +++ b/src/hotspot/share/cds/filemap.hpp @@ -53,7 +53,6 @@ class SharedClassPathEntry : public MetaspaceObj { enum { modules_image_entry, jar_entry, - signed_jar_entry, dir_entry, non_existent_entry, unknown_entry @@ -90,10 +89,6 @@ class SharedClassPathEntry : public MetaspaceObj { bool is_dir() const { return _type == dir_entry; } bool is_modules_image() const { return _type == modules_image_entry; } bool is_jar() const { return _type == jar_entry; } - bool is_signed() const { return _type == signed_jar_entry; } - void set_is_signed() { - _type = signed_jar_entry; - } bool from_class_path_attr() { return _from_class_path_attr; } time_t timestamp() const { return _timestamp; } const char* name() const; diff --git a/test/hotspot/jtreg/runtime/cds/appcds/JarBuilder.java b/test/hotspot/jtreg/runtime/cds/appcds/JarBuilder.java index 46ea9d4f684..b9c2063f3e7 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/JarBuilder.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/JarBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -259,21 +259,36 @@ public static void compileModule(Path src, } } + static final String keyTool = JDKToolFinder.getJDKTool("keytool"); + static final String jarSigner = JDKToolFinder.getJDKTool("jarsigner"); - public static void signJar() throws Exception { - String keyTool = JDKToolFinder.getJDKTool("keytool"); - String jarSigner = JDKToolFinder.getJDKTool("jarsigner"); + public static void signJarWithDisabledAlgorithm(String jarName) throws Exception { + String keyName = "key_with_disabled_alg"; + executeProcess(keyTool, + "-genkey", "-keystore", "./keystore", "-alias", keyName, + "-storepass", "abc123", "-keypass", "abc123", "-keyalg", "dsa", + "-sigalg", "SHA1withDSA", "-keysize", "512", "-dname", "CN=jvmtest2") + .shouldHaveExitValue(0); + doSigning(jarName, keyName); + } + + public static void signJar(String jarName) throws Exception { + String keyName = "mykey"; executeProcess(keyTool, - "-genkey", "-keystore", "./keystore", "-alias", "mykey", + "-genkey", "-keystore", "./keystore", "-alias", keyName, "-storepass", "abc123", "-keypass", "abc123", "-keyalg", "dsa", "-dname", "CN=jvmtest") .shouldHaveExitValue(0); + doSigning(jarName, keyName); + } + + private static void doSigning(String jarName, String keyName) throws Exception { executeProcess(jarSigner, "-keystore", "./keystore", "-storepass", "abc123", "-keypass", - "abc123", "-signedjar", getJarFilePath("signed_hello"), - getJarFilePath("hello"), "mykey") + "abc123", "-signedjar", getJarFilePath("signed_" + jarName), + getJarFilePath(jarName), keyName) .shouldHaveExitValue(0); } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/SealingViolation.java b/test/hotspot/jtreg/runtime/cds/appcds/SealingViolation.java new file mode 100644 index 00000000000..031e98541c4 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/SealingViolation.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8312434 + * @summary A jar file containing classes in the same package. Sign the jar file with + * a disabled algorithm. The jar will be treated as unsigned. + * Dump only one class into the CDS archive. During runtime, load the class + * stored in the archive and then load another class not from the archive + * but from the same pacakge. Loading of the second class should not result + * in sealing violation. + * + * @requires vm.cds + * @library /test/lib + * @compile test-classes/GenericTestApp.java test-classes/pkg/ClassInPackage.java test-classes/C2.java + * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar WhiteBox.jar jdk.test.whitebox.WhiteBox + * @run driver SealingViolation + */ + +import jdk.test.lib.helpers.ClassFileInstaller; +import jdk.test.lib.process.OutputAnalyzer; + +public class SealingViolation { + public static void main(String[] args) throws Exception { + String[] classList = {"pkg/ClassInPackage"}; + String appJar = ClassFileInstaller.writeJar("pkg-classes-sealed.jar", + ClassFileInstaller.Manifest.fromSourceFile("test-classes/pkg/package_seal.mf"), + "GenericTestApp", "pkg/ClassInPackage", "pkg/C2"); + + JarBuilder.signJarWithDisabledAlgorithm("pkg-classes-sealed"); + String signedJar = TestCommon.getTestJar("pkg-classes-sealed.jar"); + + // GenericTestApp requires WhiteBox + String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar"); + String bootclasspath = "-Xbootclasspath/a:" + wbJar; + + OutputAnalyzer output = TestCommon.dump(signedJar, classList, bootclasspath, + "-Xlog:cds+class=debug"); + output.shouldMatch("cds.class.*klasses.*app pkg.ClassInPackage") + .shouldHaveExitValue(0); + + output = TestCommon.exec(signedJar, "-Xlog:cds=debug,class+load", + bootclasspath, + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "GenericTestApp", + "assertShared:pkg.ClassInPackage", + "assertNotShared:pkg.C2"); + output.shouldHaveExitValue(0); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/SignedJar.java b/test/hotspot/jtreg/runtime/cds/appcds/SignedJar.java index 850edd6557e..1ad28f99408 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/SignedJar.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/SignedJar.java @@ -38,7 +38,7 @@ public class SignedJar { public static void main(String[] args) throws Exception { String unsignedJar = JarBuilder.getOrCreateHelloJar(); - JarBuilder.signJar(); + JarBuilder.signJar("hello"); // Test class exists in signed JAR String signedJar = TestCommon.getTestJar("signed_hello.jar"); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/pkg/package_seal.mf b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/pkg/package_seal.mf new file mode 100644 index 00000000000..ff3d31c53de --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/pkg/package_seal.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Created-By: 1.9.0-internal (Oracle Corporation) + +Name: pkg/ +Sealed: true + From ba6cdbe2c2897a0fdc266119f0fe4545c3352b8e Mon Sep 17 00:00:00 2001 From: Valerie Peng Date: Tue, 22 Aug 2023 23:49:03 +0000 Subject: [PATCH 143/162] 8309214: sun/security/pkcs11/KeyStore/CertChainRemoval.java fails after 8301154 Reviewed-by: mbaesken, jnimeh --- .../sun/security/pkcs11/P11KeyStore.java | 53 ++++++++++++++----- .../pkcs11/KeyStore/CertChainRemoval.java | 2 +- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java index de1fe22cd69..c3383f52190 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java @@ -1559,22 +1559,50 @@ private void storeCert(String alias, X509Certificate cert) cert.getSerialNumber().toByteArray())); attrList.add(new CK_ATTRIBUTE(CKA_VALUE, cert.getEncoded())); - if (alias != null) { - attrList.add(new CK_ATTRIBUTE(CKA_LABEL, alias)); - attrList.add(new CK_ATTRIBUTE(CKA_ID, alias)); - } else { - // ibutton requires something to be set - // - alias must be unique - attrList.add(new CK_ATTRIBUTE(CKA_ID, - getID(cert.getSubjectX500Principal().getName - (X500Principal.CANONICAL), cert))); - } - Session session = null; try { session = token.getOpSession(); + long[] ch = findObjects(session, + attrList.toArray(new CK_ATTRIBUTE[attrList.size()])); + if (ch.length != 0) { // found a match + if (debug != null) { + String certInfo = (alias == null? + "CA cert " + cert.getSubjectX500Principal() : + "EE cert for alias " + alias); + debug.println("storeCert: found a match for " + certInfo); + } + if (alias != null) { + // Add the alias to the existing cert + CK_ATTRIBUTE[] attrs = new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_LABEL, alias), + new CK_ATTRIBUTE(CKA_ID, alias) }; + token.p11.C_SetAttributeValue + (session.id(), ch[0], attrs); + if (debug != null) { + debug.println("storeCert: added alias: " + alias); + } + } + // done; no need to create the cert + return; + } + if (alias != null) { + attrList.add(new CK_ATTRIBUTE(CKA_LABEL, alias)); + attrList.add(new CK_ATTRIBUTE(CKA_ID, alias)); + } else { + // ibutton requires something to be set + // - alias must be unique + attrList.add(new CK_ATTRIBUTE(CKA_ID, + getID(cert.getSubjectX500Principal().getName + (X500Principal.CANONICAL), cert))); + } token.p11.C_CreateObject(session.id(), - attrList.toArray(new CK_ATTRIBUTE[attrList.size()])); + attrList.toArray(new CK_ATTRIBUTE[attrList.size()])); + if (debug != null) { + String certInfo = (alias == null? + "CA cert " + cert.getSubjectX500Principal() : + "EE cert for alias " + alias); + debug.println("storeCert: created " + certInfo); + } } finally { token.releaseSession(session); } @@ -1587,7 +1615,6 @@ private void storeChain(String alias, X509Certificate[] chain) // // end cert has CKA_LABEL and CKA_ID set to alias. // other certs in chain have neither set. - storeCert(alias, chain[0]); storeCaCerts(chain, 1); } diff --git a/test/jdk/sun/security/pkcs11/KeyStore/CertChainRemoval.java b/test/jdk/sun/security/pkcs11/KeyStore/CertChainRemoval.java index 1a93932feac..0158da0da36 100644 --- a/test/jdk/sun/security/pkcs11/KeyStore/CertChainRemoval.java +++ b/test/jdk/sun/security/pkcs11/KeyStore/CertChainRemoval.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 8301154 + * @bug 8301154 8309214 * @summary test cert chain deletion logic w/ NSS PKCS11 KeyStore * @library /test/lib .. * @run testng/othervm CertChainRemoval From 7e843c22e718ad17e0ea7223f10a26fb62477157 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Wed, 23 Aug 2023 03:28:23 +0000 Subject: [PATCH 144/162] 8284772: GHA: Use GCC Major Version Dependencies Only Reviewed-by: jwaters, shade, stuefe, erikj, serb Backport-of: 62defc3dfc4b9ba5adfe3189f34fe8b3f59b94a0 --- .github/workflows/build-cross-compile.yml | 14 ++++---------- .github/workflows/build-linux.yml | 5 +---- .github/workflows/main.yml | 9 --------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-cross-compile.yml b/.github/workflows/build-cross-compile.yml index 95f871b5b37..c056d7a1d36 100644 --- a/.github/workflows/build-cross-compile.yml +++ b/.github/workflows/build-cross-compile.yml @@ -31,12 +31,6 @@ on: gcc-major-version: required: true type: string - apt-gcc-version: - required: true - type: string - apt-gcc-cross-version: - required: true - type: string extra-conf-options: required: false type: string @@ -113,10 +107,10 @@ jobs: sudo apt-get update sudo apt-get install --only-upgrade apt sudo apt-get install \ - gcc-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \ - g++-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \ - gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \ - g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \ + gcc-${{ inputs.gcc-major-version }} \ + g++-${{ inputs.gcc-major-version }} \ + gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \ + g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \ libxrandr-dev libxtst-dev libcups2-dev libasound2-dev \ debian-ports-archive-keyring sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }} diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 1f6823c2be4..72b7cfb0613 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -49,9 +49,6 @@ on: required: false type: string default: '' - apt-gcc-version: - required: true - type: string apt-architecture: required: false type: string @@ -114,7 +111,7 @@ jobs: fi sudo apt-get update sudo apt-get install --only-upgrade apt - sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} + sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }} - name: 'Configure' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64b5cae0451..a10fc88087b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -130,7 +130,6 @@ jobs: with: platform: linux-x64 gcc-major-version: '10' - apt-gcc-version: '10.5.0-1ubuntu1~22.04' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} # The linux-x64 jdk bundle is used as buildjdk for the cross-compile job @@ -144,7 +143,6 @@ jobs: platform: linux-x86 gcc-major-version: '10' gcc-package-suffix: '-multilib' - apt-gcc-version: '10.5.0-1ubuntu1~22.04' apt-architecture: 'i386' # Some multilib libraries do not have proper inter-dependencies, so we have to # install their dependencies manually. @@ -163,7 +161,6 @@ jobs: make-target: 'hotspot' debug-levels: '[ "debug" ]' gcc-major-version: '10' - apt-gcc-version: '10.5.0-1ubuntu1~22.04' extra-conf-options: '--disable-precompiled-headers' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} @@ -178,7 +175,6 @@ jobs: make-target: 'hotspot' debug-levels: '[ "debug" ]' gcc-major-version: '10' - apt-gcc-version: '10.5.0-1ubuntu1~22.04' extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} @@ -193,7 +189,6 @@ jobs: make-target: 'hotspot' debug-levels: '[ "debug" ]' gcc-major-version: '10' - apt-gcc-version: '10.5.0-1ubuntu1~22.04' extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} @@ -209,7 +204,6 @@ jobs: # Technically this is not the "debug" level, but we can't inject a new matrix state for just this job debug-levels: '[ "debug" ]' gcc-major-version: '10' - apt-gcc-version: '10.5.0-1ubuntu1~22.04' extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} @@ -223,8 +217,6 @@ jobs: uses: ./.github/workflows/build-cross-compile.yml with: gcc-major-version: '10' - apt-gcc-version: '10.5.0-1ubuntu1~22.04' - apt-gcc-cross-version: '10.5.0-1ubuntu1~22.04cross1' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.linux-cross-compile == 'true' @@ -290,7 +282,6 @@ jobs: # build JDK, and we do not need the additional testing of the graphs. extra-conf-options: '--disable-full-docs' gcc-major-version: '10' - apt-gcc-version: '10.5.0-1ubuntu1~22.04' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.docs == 'true' From a0d0f21f0844d402191f5285a154294a2b18059a Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 23 Aug 2023 05:26:05 +0000 Subject: [PATCH 145/162] 8314752: Use google test string comparison macros Reviewed-by: coleenp, kbarrett --- .../gtest/logging/test_logConfiguration.cpp | 24 ++++++----- .../gtest/logging/test_logFileOutput.cpp | 2 +- .../logging/test_logTagSetDescriptions.cpp | 2 +- .../gtest/memory/test_guardedMemory.cpp | 2 +- .../gtest/oops/test_cpCache_output.cpp | 42 +++++++------------ .../hotspot/gtest/oops/test_instanceKlass.cpp | 10 +++-- test/hotspot/gtest/oops/test_markWord.cpp | 5 +-- .../gtest/runtime/test_classPrinter.cpp | 24 ++++++----- test/hotspot/gtest/runtime/test_globals.cpp | 6 +-- test/hotspot/gtest/runtime/test_os.cpp | 10 +++-- test/hotspot/gtest/runtime/test_os_linux.cpp | 8 ++-- .../utilities/test_globalDefinitions.cpp | 6 +-- .../utilities/test_parse_memory_size.cpp | 2 +- .../gtest/utilities/test_resourceHash.cpp | 2 +- 14 files changed, 69 insertions(+), 76 deletions(-) diff --git a/test/hotspot/gtest/logging/test_logConfiguration.cpp b/test/hotspot/gtest/logging/test_logConfiguration.cpp index c9be6965c5e..907cfcb78c2 100644 --- a/test/hotspot/gtest/logging/test_logConfiguration.cpp +++ b/test/hotspot/gtest/logging/test_logConfiguration.cpp @@ -36,6 +36,8 @@ #include "unittest.hpp" #include "utilities/ostream.hpp" +using testing::HasSubstr; + class LogConfigurationTest : public LogTestFixture { protected: static char _all_decorators[256]; @@ -71,26 +73,26 @@ TEST_VM_F(LogConfigurationTest, describe) { const char* description = ss.as_string(); // Verify that stdout and stderr are listed by default - EXPECT_PRED2(string_contains_substring, description, LogConfiguration::StdoutLog->name()); - EXPECT_PRED2(string_contains_substring, description, LogConfiguration::StderrLog->name()); + EXPECT_THAT(description, HasSubstr(LogConfiguration::StdoutLog->name())); + EXPECT_THAT(description, HasSubstr(LogConfiguration::StderrLog->name())); // Verify that each tag, level and decorator is listed for (size_t i = 0; i < LogTag::Count; i++) { - EXPECT_PRED2(string_contains_substring, description, LogTag::name(static_cast(i))); + EXPECT_THAT(description, HasSubstr(LogTag::name(static_cast(i)))); } for (size_t i = 0; i < LogLevel::Count; i++) { - EXPECT_PRED2(string_contains_substring, description, LogLevel::name(static_cast(i))); + EXPECT_THAT(description, HasSubstr(LogLevel::name(static_cast(i)))); } for (size_t i = 0; i < LogDecorators::Count; i++) { - EXPECT_PRED2(string_contains_substring, description, LogDecorators::name(static_cast(i))); + EXPECT_THAT(description, HasSubstr(LogDecorators::name(static_cast(i)))); } // Verify that the default configuration is printed char expected_buf[256]; int ret = jio_snprintf(expected_buf, sizeof(expected_buf), "=%s", LogLevel::name(LogLevel::Default)); ASSERT_NE(-1, ret); - EXPECT_PRED2(string_contains_substring, description, expected_buf); - EXPECT_PRED2(string_contains_substring, description, "#1: stderr all=off"); + EXPECT_THAT(description, HasSubstr(expected_buf)); + EXPECT_THAT(description, HasSubstr("#1: stderr all=off")); // Verify default decorators are listed LogDecorators default_decorators; @@ -107,7 +109,7 @@ TEST_VM_F(LogConfigurationTest, describe) { ASSERT_NE(-1, ret); } } - EXPECT_PRED2(string_contains_substring, description, expected_buf); + EXPECT_THAT(description, HasSubstr(expected_buf)); // Add a new output and verify that it gets described after it has been added const char* what = "all=trace"; @@ -493,8 +495,8 @@ TEST_VM_F(LogConfigurationTest, parse_invalid_tagset) { bool success = LogConfiguration::parse_log_arguments("stdout", invalid_tagset, NULL, NULL, &ss); const char* msg = ss.as_string(); EXPECT_TRUE(success) << "Should only cause a warning, not an error"; - EXPECT_TRUE(string_contains_substring(msg, "No tag set matches selection:")); - EXPECT_TRUE(string_contains_substring(msg, invalid_tagset)); + EXPECT_THAT(msg, HasSubstr("No tag set matches selection:")); + EXPECT_THAT(msg, HasSubstr(invalid_tagset)); } TEST_VM_F(LogConfigurationTest, output_name_normalization) { @@ -559,7 +561,7 @@ TEST_VM_F(LogConfigurationTest, suggest_similar_selection) { const char* suggestion = ss.as_string(); SCOPED_TRACE(suggestion); - EXPECT_TRUE(string_contains_substring(ss.as_string(), "Did you mean any of the following?")); + EXPECT_THAT(suggestion, HasSubstr("Did you mean any of the following?")); EXPECT_TRUE(string_contains_substring(suggestion, "logging") || string_contains_substring(suggestion, "start") || string_contains_substring(suggestion, "exit") || diff --git a/test/hotspot/gtest/logging/test_logFileOutput.cpp b/test/hotspot/gtest/logging/test_logFileOutput.cpp index 770d0c04b80..7ea5f78b9e1 100644 --- a/test/hotspot/gtest/logging/test_logFileOutput.cpp +++ b/test/hotspot/gtest/logging/test_logFileOutput.cpp @@ -188,7 +188,7 @@ TEST_VM(LogFileOutput, invalid_file) { EXPECT_FALSE(bad_file.initialize("", &ss)) << "file was initialized when there was an existing directory with the same name"; char* logger_output = ss.as_string(); - EXPECT_TRUE(string_contains_substring(logger_output, expected_output_substring)) + EXPECT_THAT(logger_output, testing::HasSubstr(expected_output_substring)) << "missing expected error message, received msg: %s" << logger_output; delete_empty_directory(path); } diff --git a/test/hotspot/gtest/logging/test_logTagSetDescriptions.cpp b/test/hotspot/gtest/logging/test_logTagSetDescriptions.cpp index 84253e19433..069e6877e32 100644 --- a/test/hotspot/gtest/logging/test_logTagSetDescriptions.cpp +++ b/test/hotspot/gtest/logging/test_logTagSetDescriptions.cpp @@ -42,7 +42,7 @@ TEST_VM(LogTagSetDescriptions, describe) { ResourceMark rm; stringStream stream; LogConfiguration::describe(&stream); - EXPECT_PRED2(string_contains_substring, stream.as_string(), expected) + EXPECT_THAT(stream.base(), testing::HasSubstr(expected)) << "missing log tag set descriptions in LogConfiguration::describe"; } } diff --git a/test/hotspot/gtest/memory/test_guardedMemory.cpp b/test/hotspot/gtest/memory/test_guardedMemory.cpp index 93047324fe5..9e1d1754d3e 100644 --- a/test/hotspot/gtest/memory/test_guardedMemory.cpp +++ b/test/hotspot/gtest/memory/test_guardedMemory.cpp @@ -139,7 +139,7 @@ TEST(GuardedMemory, wrap) { if (HasFatalFailure()) { return; } - EXPECT_EQ(0, strcmp(str, str_copy)) << "Not identical copy"; + EXPECT_STREQ(str, str_copy) << "Not identical copy"; EXPECT_TRUE(GuardedMemory::free_copy(str_copy)) << "Free copy failed to verify"; void* no_data = NULL; diff --git a/test/hotspot/gtest/oops/test_cpCache_output.cpp b/test/hotspot/gtest/oops/test_cpCache_output.cpp index 8d5015e6eeb..75d8b78091b 100644 --- a/test/hotspot/gtest/oops/test_cpCache_output.cpp +++ b/test/hotspot/gtest/oops/test_cpCache_output.cpp @@ -42,31 +42,21 @@ TEST_VM(ConstantPoolCache, print_on) { klass->constants()->cache()->print_on(&ss); const char* output = ss.freeze(); - // method entry test - ASSERT_TRUE(strstr(output, "this") != NULL) << "must have \"this\""; - ASSERT_TRUE(strstr(output, "bytecode 1:") != NULL) << "must have \"bytecode 1\""; - ASSERT_TRUE(strstr(output, "bytecode 2:") != NULL) << "must have \"bytecode 2\""; - ASSERT_TRUE(strstr(output, "cp index:") != NULL) << "must have constant pool index"; - ASSERT_TRUE(strstr(output, "F1:") != NULL) << "must have F1 value"; - ASSERT_TRUE(strstr(output, "F2:") != NULL) << "must have F2 value"; - ASSERT_TRUE(strstr(output, "method:") != NULL) << "must have a method"; - ASSERT_TRUE(strstr(output, "flag values:") != NULL) << "must have a flag"; - ASSERT_TRUE(strstr(output, "tos:") != NULL) << "must have result type"; - ASSERT_TRUE(strstr(output, "local signature:") != NULL) << "must have local signature flag"; - ASSERT_TRUE(strstr(output, "has appendix:") != NULL) << "must have appendix flag"; - ASSERT_TRUE(strstr(output, "forced virtual:") != NULL) << "must have forced virtual flag"; - ASSERT_TRUE(strstr(output, "final:") != NULL) << "must have final flag"; - ASSERT_TRUE(strstr(output, "virtual final:") != NULL) << "must have virtual final flag"; - ASSERT_TRUE(strstr(output, "resolution failed:") != NULL) << "must have resolution failed flag"; - ASSERT_TRUE(strstr(output, "num parameters:") != NULL) << "must have number of parameters"; + static const char* const expected_strings[] = { + // Method entry tests: + "this", "bytecode 1:", "bytecode 2:", "cp index:", "F1:", "F2:", + "method:", "flag values:", "tos:", "local signature:", "has appendix:", + "forced virtual:", "final:", "virtual final:", "resolution failed:", + "num parameters:", + + // field entry test + "Offset:", "Field Index:", "CP Index:", "TOS:", "Is Final:", "Is Volatile:", + "Put Bytecode:", "Get Bytecode:", + nullptr + }; + + for (int i = 0; expected_strings[i] != nullptr; i++) { + ASSERT_THAT(output, testing::HasSubstr(expected_strings[i])); + } - // field entry test - ASSERT_TRUE(strstr(output, "Offset:") != NULL) << "must have field offset"; - ASSERT_TRUE(strstr(output, "Field Index:") != NULL) << "must have field index"; - ASSERT_TRUE(strstr(output, "CP Index:") != NULL) << "must have constant pool index"; - ASSERT_TRUE(strstr(output, "TOS:") != NULL) << "must have type"; - ASSERT_TRUE(strstr(output, "Is Final:") != NULL) << "must have final flag"; - ASSERT_TRUE(strstr(output, "Is Volatile:") != NULL) << "must have volatile flag"; - ASSERT_TRUE(strstr(output, "Put Bytecode:") != NULL) << "must have \"put code\""; - ASSERT_TRUE(strstr(output, "Get Bytecode:") != NULL) << "must have \"get code\""; } diff --git a/test/hotspot/gtest/oops/test_instanceKlass.cpp b/test/hotspot/gtest/oops/test_instanceKlass.cpp index dd7982e88aa..b99cad55459 100644 --- a/test/hotspot/gtest/oops/test_instanceKlass.cpp +++ b/test/hotspot/gtest/oops/test_instanceKlass.cpp @@ -33,6 +33,8 @@ #include "runtime/interfaceSupport.inline.hpp" #include "unittest.hpp" +using testing::HasSubstr; + // Tests for InstanceKlass::is_class_loader_instance_klass() function TEST_VM(InstanceKlass, class_loader_class) { InstanceKlass* klass = vmClasses::ClassLoader_klass(); @@ -51,20 +53,20 @@ TEST_VM(InstanceKlass, class_loader_printer) { stringStream st; loader->print_on(&st); // See if injected loader_data field is printed in string - ASSERT_TRUE(strstr(st.as_string(), "injected 'loader_data'") != NULL) << "Must contain injected fields"; + ASSERT_THAT(st.base(), HasSubstr("injected 'loader_data'")) << "Must contain injected fields"; st.reset(); // See if mirror injected fields are printed. oop mirror = vmClasses::ClassLoader_klass()->java_mirror(); mirror->print_on(&st); - ASSERT_TRUE(strstr(st.as_string(), "injected 'protection_domain'") != NULL) << "Must contain injected fields"; + ASSERT_THAT(st.base(), HasSubstr("injected 'protection_domain'")) << "Must contain injected fields"; // We should test other printing functions too. #ifndef PRODUCT st.reset(); // method printing is non-product Method* method = vmClasses::ClassLoader_klass()->methods()->at(0); // we know there's a method here! method->print_on(&st); - ASSERT_TRUE(strstr(st.as_string(), "method holder:") != NULL) << "Must contain method_holder field"; - ASSERT_TRUE(strstr(st.as_string(), "'java/lang/ClassLoader'") != NULL) << "Must be in ClassLoader"; + ASSERT_THAT(st.base(), HasSubstr("method holder:")) << "Must contain method_holder field"; + ASSERT_THAT(st.base(), HasSubstr("'java/lang/ClassLoader'")) << "Must be in ClassLoader"; #endif } diff --git a/test/hotspot/gtest/oops/test_markWord.cpp b/test/hotspot/gtest/oops/test_markWord.cpp index e6ab7c8ca6f..2797bafc032 100644 --- a/test/hotspot/gtest/oops/test_markWord.cpp +++ b/test/hotspot/gtest/oops/test_markWord.cpp @@ -40,14 +40,11 @@ // The test doesn't work for PRODUCT because it needs WizardMode #ifndef PRODUCT -static bool test_pattern(stringStream* st, const char* pattern) { - return (strstr(st->as_string(), pattern) != NULL); -} static void assert_test_pattern(Handle object, const char* pattern) { stringStream st; object->print_on(&st); - ASSERT_TRUE(test_pattern(&st, pattern)) << pattern << " not in " << st.as_string(); + ASSERT_THAT(st.base(), testing::HasSubstr(pattern)); } class LockerThread : public JavaTestThread { diff --git a/test/hotspot/gtest/runtime/test_classPrinter.cpp b/test/hotspot/gtest/runtime/test_classPrinter.cpp index 8af285a6dde..a2b6860f3d9 100644 --- a/test/hotspot/gtest/runtime/test_classPrinter.cpp +++ b/test/hotspot/gtest/runtime/test_classPrinter.cpp @@ -29,6 +29,8 @@ #include "utilities/ostream.hpp" #include "unittest.hpp" +using testing::HasSubstr; + TEST_VM(ClassPrinter, print_classes) { JavaThread* THREAD = JavaThread::current(); ThreadInVMfromNative invm(THREAD); @@ -38,9 +40,9 @@ TEST_VM(ClassPrinter, print_classes) { ClassPrinter::print_classes("java/lang/Object", 0x03, &ss); const char* output = ss.freeze(); - ASSERT_TRUE(strstr(output, "class java/lang/Object loader data:") != NULL) << "must find java/lang/Object"; - ASSERT_TRUE(strstr(output, "method wait : (J)V") != NULL) << "must find java/lang/Object::wait"; - ASSERT_TRUE(strstr(output, "method finalize : ()V\n 0 return") != NULL) << "must find java/lang/Object::finalize and disasm"; + ASSERT_THAT(output, HasSubstr("class java/lang/Object loader data:")) << "must find java/lang/Object"; + ASSERT_THAT(output, HasSubstr("method wait : (J)V")) << "must find java/lang/Object::wait"; + ASSERT_THAT(output, HasSubstr("method finalize : ()V\n 0 return")) << "must find java/lang/Object::finalize and disasm"; } TEST_VM(ClassPrinter, print_methods) { @@ -51,16 +53,16 @@ TEST_VM(ClassPrinter, print_methods) { stringStream s1; ClassPrinter::print_methods("*ang/Object*", "wait", 0x1, &s1); const char* o1 = s1.freeze(); - ASSERT_TRUE(strstr(o1, "class java/lang/Object loader data:") != NULL) << "must find java/lang/Object"; - ASSERT_TRUE(strstr(o1, "method wait : (J)V") != NULL) << "must find java/lang/Object::wait(long)"; - ASSERT_TRUE(strstr(o1, "method wait : ()V") != NULL) << "must find java/lang/Object::wait()"; - ASSERT_TRUE(strstr(o1, "method finalize : ()V") == NULL) << "must not find java/lang/Object::finalize"; + ASSERT_THAT(o1, HasSubstr("class java/lang/Object loader data:")) << "must find java/lang/Object"; + ASSERT_THAT(o1, HasSubstr("method wait : (J)V")) << "must find java/lang/Object::wait(long)"; + ASSERT_THAT(o1, HasSubstr("method wait : ()V")) << "must find java/lang/Object::wait()"; + ASSERT_THAT(o1, Not(HasSubstr("method finalize : ()V"))) << "must not find java/lang/Object::finalize"; stringStream s2; ClassPrinter::print_methods("j*ang/Object*", "wait:(*J*)V", 0x1, &s2); const char* o2 = s2.freeze(); - ASSERT_TRUE(strstr(o2, "class java/lang/Object loader data:") != NULL) << "must find java/lang/Object"; - ASSERT_TRUE(strstr(o2, "method wait : (J)V") != NULL) << "must find java/lang/Object::wait(long)"; - ASSERT_TRUE(strstr(o2, "method wait : (JI)V") != NULL) << "must find java/lang/Object::wait(long,int)"; - ASSERT_TRUE(strstr(o2, "method wait : ()V") == NULL) << "must not find java/lang/Object::wait()"; + ASSERT_THAT(o2, HasSubstr("class java/lang/Object loader data:")) << "must find java/lang/Object"; + ASSERT_THAT(o2, HasSubstr("method wait : (J)V")) << "must find java/lang/Object::wait(long)"; + ASSERT_THAT(o2, HasSubstr("method wait : (JI)V")) << "must find java/lang/Object::wait(long,int)"; + ASSERT_THAT(o2, Not(HasSubstr("method wait : ()V"))) << "must not find java/lang/Object::wait()"; } diff --git a/test/hotspot/gtest/runtime/test_globals.cpp b/test/hotspot/gtest/runtime/test_globals.cpp index 04724303e42..1b0d58f8fb4 100644 --- a/test/hotspot/gtest/runtime/test_globals.cpp +++ b/test/hotspot/gtest/runtime/test_globals.cpp @@ -77,11 +77,11 @@ TEST_VM(FlagGuard, ccstr_flag) { TEST_VM(FlagAccess, ccstr_flag) { FLAG_SET_CMDLINE(SharedArchiveConfigFile, ""); ASSERT_EQ(FLAG_IS_CMDLINE(SharedArchiveConfigFile), true); - ASSERT_EQ(strcmp(SharedArchiveConfigFile, ""), 0); + EXPECT_STREQ(SharedArchiveConfigFile, ""); FLAG_SET_ERGO(SharedArchiveConfigFile, "foobar"); ASSERT_EQ(FLAG_IS_ERGO(SharedArchiveConfigFile), true); - ASSERT_EQ(strcmp(SharedArchiveConfigFile, "foobar") , 0); + EXPECT_STREQ(SharedArchiveConfigFile, "foobar"); FLAG_SET_ERGO(SharedArchiveConfigFile, nullptr); ASSERT_EQ(FLAG_IS_ERGO(SharedArchiveConfigFile), true); @@ -89,7 +89,7 @@ TEST_VM(FlagAccess, ccstr_flag) { FLAG_SET_ERGO(SharedArchiveConfigFile, "xyz"); ASSERT_EQ(FLAG_IS_ERGO(SharedArchiveConfigFile), true); - ASSERT_EQ(strcmp(SharedArchiveConfigFile, "xyz"), 0); + EXPECT_STREQ(SharedArchiveConfigFile, "xyz"); } template diff --git a/test/hotspot/gtest/runtime/test_os.cpp b/test/hotspot/gtest/runtime/test_os.cpp index 81c72d88556..9fcf6bb2b08 100644 --- a/test/hotspot/gtest/runtime/test_os.cpp +++ b/test/hotspot/gtest/runtime/test_os.cpp @@ -38,6 +38,8 @@ #include "os_windows.hpp" #endif +using testing::HasSubstr; + static size_t small_page_size() { return os::vm_page_size(); } @@ -171,7 +173,7 @@ static void do_test_print_hex_dump(address addr, size_t len, int unitsize, const os::print_hex_dump(&ss, addr, addr + len, unitsize); // tty->print_cr("expected: %s", expected); // tty->print_cr("result: %s", buf); - EXPECT_THAT(buf, testing::HasSubstr(expected)); + EXPECT_THAT(buf, HasSubstr(expected)); } TEST_VM(os, test_print_hex_dump) { @@ -768,7 +770,7 @@ TEST_VM(os, pagesizes_test_print) { char buffer[256]; stringStream ss(buffer, sizeof(buffer)); pss.print_on(&ss); - ASSERT_EQ(strcmp(expected, buffer), 0); + EXPECT_STREQ(expected, buffer); } TEST_VM(os, dll_address_to_function_and_library_name) { @@ -777,9 +779,9 @@ TEST_VM(os, dll_address_to_function_and_library_name) { stringStream st(output, sizeof(output)); #define EXPECT_CONTAINS(haystack, needle) \ - EXPECT_NE(::strstr(haystack, needle), (char*)NULL) + EXPECT_THAT(haystack, HasSubstr(needle)); #define EXPECT_DOES_NOT_CONTAIN(haystack, needle) \ - EXPECT_EQ(::strstr(haystack, needle), (char*)NULL) + EXPECT_THAT(haystack, Not(HasSubstr(needle))); // #define LOG(...) tty->print_cr(__VA_ARGS__); // enable if needed #define LOG(...) diff --git a/test/hotspot/gtest/runtime/test_os_linux.cpp b/test/hotspot/gtest/runtime/test_os_linux.cpp index b1826276e00..53534fc58bf 100644 --- a/test/hotspot/gtest/runtime/test_os_linux.cpp +++ b/test/hotspot/gtest/runtime/test_os_linux.cpp @@ -433,7 +433,7 @@ TEST(os_linux, addr_to_function_valid) { int offset = -1; address valid_function_pointer = (address)JNI_CreateJavaVM; ASSERT_TRUE(os::dll_address_to_function_name(valid_function_pointer, buf, sizeof(buf), &offset, true)); - ASSERT_TRUE(strstr(buf, "JNI_CreateJavaVM") != nullptr); + ASSERT_THAT(buf, testing::HasSubstr("JNI_CreateJavaVM")); ASSERT_TRUE(offset >= 0); } @@ -444,7 +444,7 @@ TEST_VM(os_linux, decoder_get_source_info_valid) { int line = -1; address valid_function_pointer = (address)ReportJNIFatalError; ASSERT_TRUE(Decoder::get_source_info(valid_function_pointer, buf, sizeof(buf), &line)); - ASSERT_TRUE(strcmp(buf, "jniCheck.hpp") == 0); + EXPECT_STREQ(buf, "jniCheck.hpp"); ASSERT_TRUE(line > 0); } @@ -471,7 +471,7 @@ TEST_VM(os_linux, decoder_get_source_info_valid_overflow) { int line = -1; address valid_function_pointer = (address)ReportJNIFatalError; ASSERT_TRUE(Decoder::get_source_info(valid_function_pointer, buf, 11, &line)); - ASSERT_TRUE(strcmp(buf, "") == 0); + EXPECT_STREQ(buf, ""); ASSERT_TRUE(line > 0); } @@ -482,7 +482,7 @@ TEST_VM(os_linux, decoder_get_source_info_valid_overflow_minimal) { int line = -1; address valid_function_pointer = (address)ReportJNIFatalError; ASSERT_TRUE(Decoder::get_source_info(valid_function_pointer, buf, 2, &line)); - ASSERT_TRUE(strcmp(buf, "L") == 0); // Overflow message does not fit, so we fall back to "L:line_number" + EXPECT_STREQ(buf, "L"); // Overflow message does not fit, so we fall back to "L:line_number" ASSERT_TRUE(line > 0); // Line should correctly be found and returned } #endif // clang diff --git a/test/hotspot/gtest/utilities/test_globalDefinitions.cpp b/test/hotspot/gtest/utilities/test_globalDefinitions.cpp index dfaa4a31a29..5dc43fb543f 100644 --- a/test/hotspot/gtest/utilities/test_globalDefinitions.cpp +++ b/test/hotspot/gtest/utilities/test_globalDefinitions.cpp @@ -226,11 +226,9 @@ TEST(globalDefinitions, array_size) { stringStream out; \ out.print((format), (value)); \ const char* result = out.as_string(); \ - EXPECT_EQ(strcmp(result, (expected)), 0) << "Failed with" \ + EXPECT_STREQ((result), (expected)) << "Failed with" \ << " format '" << (format) << "'" \ - << " value '" << (value) << "'" \ - << " result '" << result << "'" \ - << " expected '" << (expected) << "'"; \ + << " value '" << (value); \ } while (false) TEST(globalDefinitions, format_specifiers) { diff --git a/test/hotspot/gtest/utilities/test_parse_memory_size.cpp b/test/hotspot/gtest/utilities/test_parse_memory_size.cpp index 8ce02c6cea6..c723966fa9c 100644 --- a/test/hotspot/gtest/utilities/test_parse_memory_size.cpp +++ b/test/hotspot/gtest/utilities/test_parse_memory_size.cpp @@ -66,7 +66,7 @@ static void do_test_valid(T expected_value, const char* pattern) { ASSERT_TRUE(rc); ASSERT_EQ(value, expected_value); ASSERT_EQ(end, ss.base() + strlen(pattern)); - ASSERT_EQ(strcmp(end, ":-)"), 0); + EXPECT_STREQ(end, ":-)"); rc = parse_integer(ss.base(), &value); ASSERT_FALSE(rc); diff --git a/test/hotspot/gtest/utilities/test_resourceHash.cpp b/test/hotspot/gtest/utilities/test_resourceHash.cpp index 1e6c00871f5..9124f4b977c 100644 --- a/test/hotspot/gtest/utilities/test_resourceHash.cpp +++ b/test/hotspot/gtest/utilities/test_resourceHash.cpp @@ -468,7 +468,7 @@ TEST_VM_F(ResourceHashtablePrintTest, print_test) { const char* strings[] = { "Number of buckets", "Number of entries", "300", "Number of literals", "Average bucket size", "Maximum bucket size" }; for (const auto& str : strings) { - ASSERT_TRUE(strstr(st.as_string(), str) != nullptr) << "string not present " << str; + ASSERT_THAT(st.base(), testing::HasSubstr(str)); } // Cleanup: need to delete pointers in entries TableDeleter deleter; From d1de3d082ef9b83aaa68664e653ab09feb8bad87 Mon Sep 17 00:00:00 2001 From: Kimura Yukihiro Date: Wed, 23 Aug 2023 06:04:28 +0000 Subject: [PATCH 146/162] 8313901: [TESTBUG] test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java fails with java.lang.VirtualMachineError Reviewed-by: shade, thartmann --- .../jtreg/compiler/codecache/CodeCacheFullCountTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java index 8646c5834c6..9b1a5e89071 100644 --- a/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java +++ b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,11 @@ public static void runTest() throws Throwable { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "-XX:-MethodFlushing", "CodeCacheFullCountTest", "WasteCodeCache"); OutputAnalyzer oa = ProcessTools.executeProcess(pb); - oa.shouldHaveExitValue(0); + // Ignore adapter creation failures + if (oa.getExitValue() != 0 && !oa.getStderr().contains("Out of space in CodeCache for adapters")) { + oa.reportDiagnosticSummary(); + throw new RuntimeException("VM finished with exit code " + oa.getExitValue()); + } String stdout = oa.getStdout(); Pattern pattern = Pattern.compile("full_count=(\\d)"); From 571c435e1a34dcf08fd7545d531c258c9116ea79 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 23 Aug 2023 06:26:18 +0000 Subject: [PATCH 147/162] 8313374: --enable-ccache's CCACHE_BASEDIR breaks builds Reviewed-by: erikj --- make/common/NativeCompilation.gmk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index 8609fc4ca00..e97d8767ce2 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -215,7 +215,21 @@ DEPENDENCY_TARGET_SED_PATTERN := \ # The fix-deps-file macro is used to adjust the contents of the generated make # dependency files to contain paths compatible with make. # +REWRITE_PATHS_RELATIVE = false ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-) + REWRITE_PATHS_RELATIVE = true +endif + +# CCACHE_BASEDIR needs fix-deps-file as makefiles use absolute filenames for +# object files while CCACHE_BASEDIR will make ccache relativize all paths for +# its compiler. The compiler then produces relative dependency files. +# make does not know a relative and absolute filename is the same so it will +# ignore such dependencies. +ifneq ($(CCACHE), ) + REWRITE_PATHS_RELATIVE = true +endif + +ifeq ($(REWRITE_PATHS_RELATIVE), true) # Need to handle -I flags as both '-Ifoo' and '-I foo'. MakeCommandRelative = \ $(CD) $(WORKSPACE_ROOT) && \ From 2be469f89ec10471e893045e606e1e2558f4e363 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 23 Aug 2023 07:17:29 +0000 Subject: [PATCH 148/162] 8314743: Use of uninitialized local in SR_initialize after JDK-8314114 Reviewed-by: dholmes, coleenp --- src/hotspot/os/posix/signals_posix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/os/posix/signals_posix.cpp b/src/hotspot/os/posix/signals_posix.cpp index bbe4b7782bf..0b66170c2df 100644 --- a/src/hotspot/os/posix/signals_posix.cpp +++ b/src/hotspot/os/posix/signals_posix.cpp @@ -1733,8 +1733,8 @@ int SR_initialize() { sig < NSIG) { // Must be legal signal and fit into sigflags[]. PosixSignals::SR_signum = sig; } else { - warning("You set _JAVA_SR_SIGNUM=%d. It must be in range [%d, %d]. Using %d instead.", - sig, MAX2(SIGSEGV, SIGBUS)+1, NSIG-1, PosixSignals::SR_signum); + warning("You set _JAVA_SR_SIGNUM=%s. It must be a number in range [%d, %d]. Using %d instead.", + s, MAX2(SIGSEGV, SIGBUS)+1, NSIG-1, PosixSignals::SR_signum); } } From f8203cb272e6136b784e5c43a500f6a0bfb19c8b Mon Sep 17 00:00:00 2001 From: Tobias Holenstein Date: Wed, 23 Aug 2023 08:47:33 +0000 Subject: [PATCH 149/162] 8313626: C2 crash due to unexpected exception control flow Reviewed-by: thartmann, chagedorn --- src/hotspot/share/opto/doCall.cpp | 4 + .../parsing/MissingSafepointOnTryCatch.jasm | 111 ++++++++++++++++++ .../TestMissingSafepointOnTryCatch.java | 65 ++++++++++ 3 files changed, 180 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm create mode 100644 test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp index 7e9e08a7e1b..094f8a58805 100644 --- a/src/hotspot/share/opto/doCall.cpp +++ b/src/hotspot/share/opto/doCall.cpp @@ -997,6 +997,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) { if (PrintOpto && WizardMode) { tty->print_cr(" Catching every inline exception bci:%d -> handler_bci:%d", bci(), handler_bci); } + // If this is a backwards branch in the bytecodes, add safepoint + maybe_add_safepoint(handler_bci); merge_exception(handler_bci); // jump to handler return; // No more handling to be done here! } @@ -1028,6 +1030,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) { klass->print_name(); tty->cr(); } + // If this is a backwards branch in the bytecodes, add safepoint + maybe_add_safepoint(handler_bci); merge_exception(handler_bci); } set_control(not_subtype_ctrl); diff --git a/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm b/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm new file mode 100644 index 00000000000..5d5fced0cb3 --- /dev/null +++ b/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class MissingSafepointOnTryCatch version 52:0 { + + static Method m:"()V" { + return; + } + + static Method test1:"()V" stack 1 { + try t; + invokestatic m:"()V"; + return; + + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + athrow; + endtry t; + } + + static Method test2:"()V" stack 1 { + try t0; + try t1; + invokestatic m:"()V"; + endtry t1; + return; + + catch t1 java/lang/Exception; + stack_map class java/lang/Exception; + return; + + catch t0 java/lang/Throwable; + stack_map class java/lang/Throwable; + athrow; + endtry t0; + } + + public static Method th:"()V" + throws java/lang/Exception + stack 2 locals 0 + { + new class java/lang/Exception; + dup; + invokespecial Method java/lang/Exception."":"()V"; + athrow; + } + + static Method test3:"()V" stack 1 locals 2 { + try t; + invokestatic m:"()V"; + iconst_1; + istore_0; + iconst_0; + istore_1; + return; + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + invokestatic th:"()V"; + return; + endtry t; + } + + static Method test4:"()V" stack 2 locals 2 { + try t; + invokestatic m:"()V"; + iconst_1; + istore_0; + iconst_0; + istore_1; + return; + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + iconst_1; + istore_0; + invokestatic th:"()V"; + return; + endtry t; + } + + static Method testInfinite:"()V" stack 1 { + try t; + invokestatic th:"()V"; + return; + + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + athrow; + endtry t; + } + +} // end Class MissingSafepointOnTryCatch diff --git a/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java b/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java new file mode 100644 index 00000000000..9a8a3135794 --- /dev/null +++ b/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8313626 + * @summary assert(false) failed: malformed control flow to missing safepoint on backedge of a try-catch + * @library /test/lib + * @compile MissingSafepointOnTryCatch.jasm + * @run main/othervm -XX:CompileCommand=quiet + * -XX:CompileCommand=compileonly,MissingSafepointOnTryCatch::test* + * -XX:CompileCommand=dontinline,MissingSafepointOnTryCatch::m + * -XX:CompileCommand=inline,MissingSafepointOnTryCatch::th + * -XX:-TieredCompilation -Xcomp TestMissingSafepointOnTryCatch + */ + +import jdk.test.lib.Utils; + +public class TestMissingSafepointOnTryCatch { + + public static void infiniteLoop() { + try { + Thread thread = new Thread() { + public void run() { + MissingSafepointOnTryCatch.testInfinite(); + } + }; + thread.setDaemon(true); + thread.start(); + Thread.sleep(Utils.adjustTimeout(500)); + } catch (Exception e) {} + } + + public static void main(String[] args) { + try { + // to make sure java/lang/Exception class is resolved + MissingSafepointOnTryCatch.th(); + } catch (Exception e) {} + MissingSafepointOnTryCatch.test1(); + MissingSafepointOnTryCatch.test2(); + MissingSafepointOnTryCatch.test3(); + MissingSafepointOnTryCatch.test4(); + infiniteLoop(); + } +} From 1cee3b9fd9720e7938029a6992460b9053e65e57 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Wed, 23 Aug 2023 08:59:36 +0000 Subject: [PATCH 150/162] 8313262: C2: Sinking node may cause required cast to be dropped Reviewed-by: chagedorn, thartmann --- src/hotspot/share/opto/loopopts.cpp | 2 +- .../TestSinkingNodeDropsNotNullCast.java | 68 +++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/gc/shenandoah/compiler/TestSinkingNodeDropsNotNullCast.java diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp index e74e088c5ef..89b723bf92c 100644 --- a/src/hotspot/share/opto/loopopts.cpp +++ b/src/hotspot/share/opto/loopopts.cpp @@ -1642,7 +1642,7 @@ void PhaseIdealLoop::try_sink_out_of_loop(Node* n) { // Find control for 'x' next to use but not inside inner loops. x_ctrl = place_outside_loop(x_ctrl, n_loop); // Replace all uses - if (u->is_ConstraintCast() && u->bottom_type()->higher_equal(_igvn.type(n)) && u->in(0) == x_ctrl) { + if (u->is_ConstraintCast() && _igvn.type(n)->higher_equal(u->bottom_type()) && u->in(0) == x_ctrl) { // If we're sinking a chain of data nodes, we might have inserted a cast to pin the use which is not necessary // anymore now that we're going to pin n as well _igvn.replace_node(u, x); diff --git a/test/hotspot/jtreg/gc/shenandoah/compiler/TestSinkingNodeDropsNotNullCast.java b/test/hotspot/jtreg/gc/shenandoah/compiler/TestSinkingNodeDropsNotNullCast.java new file mode 100644 index 00000000000..4987f448aa5 --- /dev/null +++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestSinkingNodeDropsNotNullCast.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * bug 8313262 + * @summary Sinking node may cause required cast to be dropped + * @requires vm.gc.Shenandoah + * @run main/othervm -XX:-BackgroundCompilation -XX:+UseShenandoahGC TestSinkingNodeDropsNotNullCast + */ + +import java.util.Arrays; + +public class TestSinkingNodeDropsNotNullCast { + public static void main(String[] args) { + Object[] array1 = new Object[100]; + Object[] array2 = new Object[100]; + Arrays.fill(array2, new Object()); + for (int i = 0; i < 20_000; i++) { + test(array1); + test(array1); + test(array2); + } + } + + private static Object test(Object[] array) { + Object o; + int i = 1; + do { + synchronized (new Object()) { + } + o = array[i]; + if (o != null) { + if (o instanceof A) { + return ((A) o).field; + } else { + return o; + } + } + i++; + } while (i < 100); + return o; + } + + private static class A { + Object field; + } +} From 742e319a21c767d8a93e13048add961f5ca8c5d7 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Wed, 23 Aug 2023 09:45:25 +0000 Subject: [PATCH 151/162] 8314157: G1: "yielded" is not initialized on some paths after JDK-8140326 Reviewed-by: ayang, iwalulya --- .../gc/g1/g1ConcurrentRebuildAndScrub.cpp | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRebuildAndScrub.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRebuildAndScrub.cpp index bb7db02c322..8cf7601d65a 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRebuildAndScrub.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRebuildAndScrub.cpp @@ -88,12 +88,11 @@ class G1RebuildRSAndScrubTask : public WorkerTask { } // Yield if enough has been processed; returns if the concurrent marking cycle - // has been aborted for any reason. Yielded is set if there has been an actual - // yield for a pause. - bool yield_if_necessary(bool& yielded) { + // has been aborted for any reason. + bool yield_if_necessary() { if (_processed_words >= ProcessingYieldLimitInWords) { reset_processed_words(); - yielded = _cm->do_yield_check(); + _cm->do_yield_check(); } return _cm->has_aborted(); } @@ -123,13 +122,12 @@ class G1RebuildRSAndScrubTask : public WorkerTask { // Update processed words and yield, for humongous objects we will yield // after each chunk. add_processed_words(mr.word_size()); - bool yielded; - bool mark_aborted = yield_if_necessary(yielded); + bool mark_aborted = yield_if_necessary(); if (mark_aborted) { return true; - } else if (yielded && !should_rebuild_or_scrub(hr)) { + } else if (!should_rebuild_or_scrub(hr)) { // We need to check should_rebuild_or_scrub() again because the region might - // have been reclaimed during the yield. + // have been reclaimed during above yield/safepoint. log_trace(gc, marking)("Rebuild aborted for reclaimed region: %u", hr->hrm_index()); return false; } @@ -192,12 +190,12 @@ class G1RebuildRSAndScrubTask : public WorkerTask { start = scrub_to_next_live(hr, start, limit); } - bool yielded; - bool mark_aborted = yield_if_necessary(yielded); + bool mark_aborted = yield_if_necessary(); if (mark_aborted) { return true; - } else if (yielded && !should_rebuild_or_scrub(hr)) { - // Region has been reclaimed while yielding. Exit continuing with the next region. + } else if (!should_rebuild_or_scrub(hr)) { + // We need to check should_rebuild_or_scrub() again because the region might + // have been reclaimed during above yield/safepoint. log_trace(gc, marking)("Scan and scrub aborted for reclaimed region: %u", hr->hrm_index()); return false; } @@ -212,11 +210,12 @@ class G1RebuildRSAndScrubTask : public WorkerTask { while (start < limit) { start += scan_object(hr, start); // Avoid stalling safepoints and stop iteration if mark cycle has been aborted. - bool yielded = true; - bool mark_aborted = yield_if_necessary(yielded); + bool mark_aborted = yield_if_necessary(); if (mark_aborted) { return true; - } else if (yielded && !should_rebuild_or_scrub(hr)) { + } else if (!should_rebuild_or_scrub(hr)) { + // We need to check should_rebuild_or_scrub() again because the region might + // have been reclaimed during above yield/safepoint. log_trace(gc, marking)("Scan aborted for reclaimed region: %u", hr->hrm_index()); return false; } From 703817d21f6fd8b24cc670695625dfdb09d3592c Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Wed, 23 Aug 2023 10:44:40 +0000 Subject: [PATCH 152/162] 8314517: some tests fail in case ipv6 is disabled on the machine Reviewed-by: mdoerr, lucy, jpai, dfuchs --- .../simpleserver/CommandLinePositiveTest.java | 12 ++++-- .../jwebserver/CommandLinePositiveTest.java | 12 ++++-- .../InetAddress/HostsFileOrderingTest.java | 7 ++++ .../InetAddress/InternalNameServiceTest.java | 25 ++++++------ .../InternalNameServiceWithHostsFileTest.java | 39 ++++++++++++------- .../DontFragmentTest.java | 34 +++++++++------- 6 files changed, 81 insertions(+), 48 deletions(-) diff --git a/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePositiveTest.java b/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePositiveTest.java index fce013460c1..8cf1f8daf94 100644 --- a/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePositiveTest.java +++ b/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePositiveTest.java @@ -25,6 +25,7 @@ * @test * @summary Positive tests for java -m jdk.httpserver command * @library /test/lib + * @build jdk.test.lib.net.IPSupport * @modules jdk.httpserver * @run testng/othervm CommandLinePositiveTest */ @@ -35,6 +36,7 @@ import java.nio.file.Path; import java.util.concurrent.TimeUnit; import jdk.test.lib.Platform; +import jdk.test.lib.net.IPSupport; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.util.FileUtils; @@ -154,10 +156,12 @@ public void testBindAllInterfaces(String opt) throws Throwable { .shouldHaveExitValue(NORMAL_EXIT_CODE) .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on 0.0.0.0 (all interfaces) port") .shouldContain("URL http://" + InetAddress.getLocalHost().getHostAddress()); - simpleserver(JAVA, "-m", "jdk.httpserver", opt, "::0") - .shouldHaveExitValue(NORMAL_EXIT_CODE) - .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on 0.0.0.0 (all interfaces) port") - .shouldContain("URL http://" + InetAddress.getLocalHost().getHostAddress()); + if (IPSupport.hasIPv6()) { + simpleserver(JAVA, "-m", "jdk.httpserver", opt, "::0") + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on 0.0.0.0 (all interfaces) port") + .shouldContain("URL http://" + InetAddress.getLocalHost().getHostAddress()); + } } @Test(dataProvider = "bindOptions") diff --git a/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePositiveTest.java b/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePositiveTest.java index c3a63371828..88a843bc4ac 100644 --- a/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePositiveTest.java +++ b/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePositiveTest.java @@ -25,6 +25,7 @@ * @test * @summary Positive tests for the jwebserver command-line tool * @library /test/lib + * @build jdk.test.lib.net.IPSupport * @modules jdk.httpserver * @run testng/othervm CommandLinePositiveTest */ @@ -35,6 +36,7 @@ import java.nio.file.Path; import java.util.concurrent.TimeUnit; import jdk.test.lib.Platform; +import jdk.test.lib.net.IPSupport; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.util.FileUtils; @@ -154,10 +156,12 @@ public void testBindAllInterfaces(String opt) throws Throwable { .shouldHaveExitValue(NORMAL_EXIT_CODE) .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on 0.0.0.0 (all interfaces) port") .shouldContain("URL http://" + InetAddress.getLocalHost().getHostAddress()); - simpleserver(JWEBSERVER, opt, "::0") - .shouldHaveExitValue(NORMAL_EXIT_CODE) - .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on 0.0.0.0 (all interfaces) port") - .shouldContain("URL http://" + InetAddress.getLocalHost().getHostAddress()); + if (IPSupport.hasIPv6()) { + simpleserver(JWEBSERVER, opt, "::0") + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on 0.0.0.0 (all interfaces) port") + .shouldContain("URL http://" + InetAddress.getLocalHost().getHostAddress()); + } } @Test(dataProvider = "bindOptions") diff --git a/test/jdk/java/net/InetAddress/HostsFileOrderingTest.java b/test/jdk/java/net/InetAddress/HostsFileOrderingTest.java index 9d51ebc4360..304180b6c48 100644 --- a/test/jdk/java/net/InetAddress/HostsFileOrderingTest.java +++ b/test/jdk/java/net/InetAddress/HostsFileOrderingTest.java @@ -32,6 +32,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import jdk.test.lib.net.IPSupport; + import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.testng.Assert; @@ -39,6 +41,8 @@ /* @test * @bug 8244958 + * @library /test/lib + * @build jdk.test.lib.Platform jdk.test.lib.net.IPSupport * @summary Test that "jdk.net.hosts.file" NameService implementation returns addresses * with respect to "java.net.preferIPv4Stack" and "java.net.preferIPv6Addresses" system * property values @@ -106,6 +110,9 @@ static ExpectedOrder getExpectedOrderFromSystemProperties() { PREFER_IPV4_STACK_VALUE.equalsIgnoreCase("true")) { return ExpectedOrder.IPV4_ONLY; } + if (!IPSupport.hasIPv6()) { + return ExpectedOrder.IPV4_ONLY; + } if (PREFER_IPV6_ADDRESSES_VALUE != null) { return switch(PREFER_IPV6_ADDRESSES_VALUE.toLowerCase()) { diff --git a/test/jdk/java/net/InetAddress/InternalNameServiceTest.java b/test/jdk/java/net/InetAddress/InternalNameServiceTest.java index f8aff3f90a4..2122f2ab47c 100644 --- a/test/jdk/java/net/InetAddress/InternalNameServiceTest.java +++ b/test/jdk/java/net/InetAddress/InternalNameServiceTest.java @@ -27,6 +27,8 @@ * the system property jdk.net.hosts.file. This property specifies * a file name that contains address host mappings, similar to those in * /etc/hosts file. + * @library /test/lib + * @build jdk.test.lib.net.IPSupport * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dsun.net.inetaddr.ttl=0 * InternalNameServiceTest */ @@ -38,6 +40,8 @@ import java.net.UnknownHostException; import java.util.Arrays; +import jdk.test.lib.net.IPSupport; + public class InternalNameServiceTest { static final String HOSTS_FILE_NAME = System.getProperty("jdk.net.hosts.file"); @@ -128,17 +132,16 @@ private static void testHostToIPAddressMappings(String hostsFileName) } // IPV6 tests - - // IPV6 tests - addMappingToHostsFile("host-ipv6.sample-domain", "::1", hostsFileName, - true); - testAddress = InetAddress.getByName("host-ipv6.sample-domain"); - retrievedIpAddr = testAddress.getAddress(); - if (!Arrays.equals(retrievedIpAddr, expectedIpAddrIpv6_1)) { - System.out.println("retrieved ipv6 addr == " + Arrays.toString(retrievedIpAddr)); - System.out.println("expected ipv6 addr == " + Arrays.toString(expectedIpAddrIpv6_1)); - throw new RuntimeException( - "retrieved IPV6 Addr not equal to expected IPV6 Addr"); + if (IPSupport.hasIPv6()) { + addMappingToHostsFile("host-ipv6.sample-domain", "::1", hostsFileName, true); + testAddress = InetAddress.getByName("host-ipv6.sample-domain"); + retrievedIpAddr = testAddress.getAddress(); + if (!Arrays.equals(retrievedIpAddr, expectedIpAddrIpv6_1)) { + System.out.println("retrieved ipv6 addr == " + Arrays.toString(retrievedIpAddr)); + System.out.println("expected ipv6 addr == " + Arrays.toString(expectedIpAddrIpv6_1)); + throw new RuntimeException( + "retrieved IPV6 Addr not equal to expected IPV6 Addr"); + } } } diff --git a/test/jdk/java/net/InetAddress/InternalNameServiceWithHostsFileTest.java b/test/jdk/java/net/InetAddress/InternalNameServiceWithHostsFileTest.java index 4e93ab8d7a8..35953195ea3 100644 --- a/test/jdk/java/net/InetAddress/InternalNameServiceWithHostsFileTest.java +++ b/test/jdk/java/net/InetAddress/InternalNameServiceWithHostsFileTest.java @@ -28,6 +28,8 @@ * a file name that contains address host mappings, similar to those in * /etc/hosts file. TestHosts-III file exist, with a set of ipv4 and ipv6 * mappings + * @library /test/lib + * @build jdk.test.lib.net.IPSupport * @run main/othervm -Djdk.net.hosts.file=${test.src}/TestHosts-III -Dsun.net.inetaddr.ttl=0 * InternalNameServiceWithHostsFileTest */ @@ -36,6 +38,8 @@ import java.net.UnknownHostException; import java.util.Arrays; +import jdk.test.lib.net.IPSupport; + public class InternalNameServiceWithHostsFileTest { public static void main(String args[]) throws Exception { // fe80::1 @@ -52,26 +56,31 @@ public static void main(String args[]) throws Exception { // 10.2.3.4 testHost.testDomain testHostsMapping(expectedIpv4Address, "testHost.testDomain"); - // ::1 ip6-localhost ip6-loopback - testHostsMapping(expectedIpv6LocalhostAddress, "ip6-localhost"); - // fe00::0 ip6-localnet - testHostsMapping(expectedIpv6LocalAddress, "ip6-localnet"); - // fe80::1 link-local-host - testHostsMapping(expectedIpv6Address, "link-local-host"); + + if (IPSupport.hasIPv6()) { + // ::1 ip6-localhost ip6-loopback + testHostsMapping(expectedIpv6LocalhostAddress, "ip6-localhost"); + // fe00::0 ip6-localnet + testHostsMapping(expectedIpv6LocalAddress, "ip6-localnet"); + // fe80::1 link-local-host + testHostsMapping(expectedIpv6Address, "link-local-host"); + } testReverseLookup("10.2.3.4", "testHost.testDomain"); - testReverseLookup("::1", "ip6-localhost"); - testReverseLookup("0:0:0:0:0:0:0:1", "ip6-localhost"); - testReverseLookup("0000:0000:0000:0000:0000:0000:0000:0001", "ip6-localhost"); + if (IPSupport.hasIPv6()) { + testReverseLookup("::1", "ip6-localhost"); + testReverseLookup("0:0:0:0:0:0:0:1", "ip6-localhost"); + testReverseLookup("0000:0000:0000:0000:0000:0000:0000:0001", "ip6-localhost"); - testReverseLookup("fe00::0", "ip6-localnet"); - testReverseLookup("fe00:0:0:0:0:0:0:0", "ip6-localnet"); - testReverseLookup("fe00:0000:0000:0000:0000:0000:0000:0000", "ip6-localnet"); + testReverseLookup("fe00::0", "ip6-localnet"); + testReverseLookup("fe00:0:0:0:0:0:0:0", "ip6-localnet"); + testReverseLookup("fe00:0000:0000:0000:0000:0000:0000:0000", "ip6-localnet"); - testReverseLookup("fe80::1", "link-local-host"); - testReverseLookup("fe80:000:0:00:0:000:00:1", "link-local-host"); - testReverseLookup("fe80:0000:0000:0000:0000:0000:0000:0001", "link-local-host"); + testReverseLookup("fe80::1", "link-local-host"); + testReverseLookup("fe80:000:0:00:0:000:00:1", "link-local-host"); + testReverseLookup("fe80:0000:0000:0000:0000:0000:0000:0001", "link-local-host"); + } } private static void testHostsMapping(byte[] expectedIpAddress, String hostName) diff --git a/test/jdk/jdk/net/ExtendedSocketOption/DontFragmentTest.java b/test/jdk/jdk/net/ExtendedSocketOption/DontFragmentTest.java index 76ab29092cd..9182c9630b7 100644 --- a/test/jdk/jdk/net/ExtendedSocketOption/DontFragmentTest.java +++ b/test/jdk/jdk/net/ExtendedSocketOption/DontFragmentTest.java @@ -26,7 +26,7 @@ * @bug 8243099 8285671 * @modules jdk.net * @library /test/lib - * @build jdk.test.lib.Platform + * @build jdk.test.lib.Platform jdk.test.lib.net.IPSupport * @run main/othervm DontFragmentTest ipv4 * @run main/othervm DontFragmentTest ipv6 */ @@ -35,6 +35,7 @@ import java.net.*; import java.nio.channels.*; import jdk.test.lib.Platform; +import jdk.test.lib.net.IPSupport; import static java.net.StandardProtocolFamily.INET; import static java.net.StandardProtocolFamily.INET6; import static jdk.net.ExtendedSocketOptions.IP_DONTFRAGMENT; @@ -45,19 +46,24 @@ public class DontFragmentTest { public static void main(String[] args) throws IOException { isMacos = Platform.isOSX(); - testDatagramChannel(); - StandardProtocolFamily fam = args[0].equals("ipv4") ? INET : INET6; - System.out.println("Family = " + fam); - testDatagramChannel(args, fam); - try (DatagramSocket c = new DatagramSocket()) { - testDatagramSocket(c); - } - try (DatagramChannel dc = DatagramChannel.open(fam)) { - var c = dc.socket(); - testDatagramSocket(c); - } - try (MulticastSocket mc = new MulticastSocket()) { - testDatagramSocket(mc); + boolean ipv6 = args[0].equals("ipv6"); + if (ipv6 && !IPSupport.hasIPv6()) { + System.out.println("No IPv6 support detected, skipping IPv6 test case"); + } else { + testDatagramChannel(); + StandardProtocolFamily fam = ipv6 ? INET6 : INET; + System.out.println("Family = " + fam); + testDatagramChannel(args, fam); + try (DatagramSocket c = new DatagramSocket()) { + testDatagramSocket(c); + } + try (DatagramChannel dc = DatagramChannel.open(fam)) { + var c = dc.socket(); + testDatagramSocket(c); + } + try (MulticastSocket mc = new MulticastSocket()) { + testDatagramSocket(mc); + } } } From 62610203f18095cbd25b456f0622bad033a65a5d Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Wed, 23 Aug 2023 11:48:22 +0000 Subject: [PATCH 153/162] 8312555: Ideographic characters aren't stretched by AffineTransform.scale(2, 1) Ignore bitmaps embedded into fonts for non-uniform scales Reviewed-by: prr, serb --- .../native/libfontmanager/freetypeScaler.c | 5 +- .../font/FontScaling/StretchedFontTest.java | 221 ++++++++++++++++++ 2 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 test/jdk/java/awt/font/FontScaling/StretchedFontTest.java diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c index 8f5f66fe09f..21ac280f0fb 100644 --- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c +++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -548,7 +548,8 @@ Java_sun_font_FreetypeFontScaler_createScalerContextNative( if ((aa != TEXT_AA_ON) && (fm != TEXT_FM_ON) && !context->doBold && !context->doItalize && (context->transform.yx == 0) && (context->transform.xy == 0) && - (context->transform.xx > 0) && (context->transform.yy > 0)) + (context->transform.xx > 0) && (context->transform.yy > 0) && + (context->transform.xx == context->transform.yy)) { context->useSbits = 1; } diff --git a/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java b/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java new file mode 100644 index 00000000000..da7c233f1c1 --- /dev/null +++ b/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.stream.Stream; + +import javax.imageio.ImageIO; + +import static java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment; +import static java.awt.RenderingHints.KEY_TEXT_ANTIALIASING; +import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB; +import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF; +import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON; +import static java.awt.image.BufferedImage.TYPE_3BYTE_BGR; + +/* + * @test + * @bug 8312555 + * @summary Verifies that hieroglyphs are stretched by AffineTransform.scale(2, 1) + * @run main StretchedFontTest + */ +public final class StretchedFontTest { + private static final String TEXT = "\u6F22"; + private static final int FONT_SIZE = 20; + + private static final Color BACKGROUND = Color.WHITE; + private static final Color[] FOREGROUNDS = { + new Color(0xFF000000, true), + new Color(0x7F000000, true) + }; + + private static final AffineTransform STRETCH_TRANSFORM = + AffineTransform.getScaleInstance(2.0, 1.0); + + public static void main(String[] args) { + List errors = + Arrays.stream(getLocalGraphicsEnvironment() + .getAvailableFontFamilyNames(Locale.ENGLISH)) + .map(family -> new Font(family, Font.PLAIN, FONT_SIZE)) + .filter(font -> font.canDisplay(TEXT.codePointAt(0))) + .map(font -> font.deriveFont(STRETCH_TRANSFORM)) + .flatMap(StretchedFontTest::testFont) + .filter(Objects::nonNull) + .toList(); + + if (!errors.isEmpty()) { + errors.forEach(System.err::println); + throw new Error(errors.size() + " failure(s) found;" + + " the first one: " + errors.get(0)); + } + } + + /** + * Tests the font with a set of text antialiasing hints. + * + * @param font the font to test + * @return a stream of test results + * @see #testFont(Font, Object) + */ + private static Stream testFont(final Font font) { + return Stream.of(VALUE_TEXT_ANTIALIAS_OFF, + VALUE_TEXT_ANTIALIAS_ON, + VALUE_TEXT_ANTIALIAS_LCD_HRGB) + .flatMap(hint -> testFont(font, hint)); + } + + /** + * Tests the font with the specified text antialiasing hint and a set of + * foreground colors. + * + * @param font the font to test + * @param hint the text antialiasing hint to test + * @return a stream of test results + * @see #testFont(Font, Object, Color) + */ + private static Stream testFont(final Font font, final Object hint) { + return Stream.of(FOREGROUNDS) + .map(foreground -> testFont(font, hint, foreground)); + } + + /** + * Tests the font with the specified text antialiasing hint and + * foreground color. In case of failure, it saves the rendered + * image to a file. + * + * @param font the font to test + * @param hint the text antialiasing hint to test + * @param foreground the foreground color to use + * @return {@code null} if the text rendered correctly; otherwise, + * a {@code String} with the font family name, the value of + * the rendering hint and the color in hex + */ + private static String testFont(final Font font, + final Object hint, + final Color foreground) { + final Dimension size = getTextSize(font); + final BufferedImage image = + new BufferedImage(size.width, size.height, TYPE_3BYTE_BGR); + + final Graphics2D g2d = image.createGraphics(); + try { + g2d.setColor(BACKGROUND); + g2d.fillRect(0, 0, size.width, size.height); + + g2d.setRenderingHint(KEY_TEXT_ANTIALIASING, hint); + g2d.setColor(foreground); + g2d.setFont(font); + g2d.drawString(TEXT, 0, g2d.getFontMetrics(font).getAscent()); + } finally { + g2d.dispose(); + } + + if (verifyImage(image)) { + return null; + } + String fontName = font.getFontName(Locale.ENGLISH); + String hintValue = getHintString(hint); + String hexColor = String.format("0x%08x", foreground.getRGB()); + saveImage(image, fontName + "-" + hintValue + "-" + hexColor); + return "Font: " + fontName + ", Hint: " + hintValue + ", Color: " + hexColor; + } + + /** + * Verifies the rendered image of the hieroglyph. The hieroglyph + * should be stretched across the entire width of the image. + * If the right half of the image contains only pixels of the background + * color, the hieroglyph isn't stretched correctly + * — it's a failure. + * + * @param image the image to verify + * @return {@code true} if the hieroglyph is stretched correctly; or + * {@code false} if right half of the image contains only + * background-colored pixels, which means the hieroglyph isn't + * stretched. + */ + private static boolean verifyImage(final BufferedImage image) { + final int width = image.getWidth(); + final int height = image.getHeight(); + for (int x = width / 2; x < width; x++) { + for (int y = 0; y < height; y++) { + if (image.getRGB(x, y) != BACKGROUND.getRGB()) { + // Any other color but background means the glyph is stretched + return true; + } + } + } + + // The right side of the image is filled with the background color only, + // the glyph isn't stretched. + return false; + } + + private static String getHintString(final Object hint) { + if (hint == VALUE_TEXT_ANTIALIAS_OFF) { + return "off"; + } else if (hint == VALUE_TEXT_ANTIALIAS_ON) { + return "on"; + } else if (hint == VALUE_TEXT_ANTIALIAS_LCD_HRGB) { + return "lcd"; + } else { + throw new IllegalArgumentException("Unexpected hint: " + hint); + } + } + + private static final BufferedImage dummyImage = + new BufferedImage(5, 5, TYPE_3BYTE_BGR); + + private static Dimension getTextSize(final Font font) { + final Graphics g = dummyImage.getGraphics(); + try { + return g.getFontMetrics(font) + .getStringBounds(TEXT, g) + .getBounds() + .getSize(); + } finally { + g.dispose(); + } + } + + private static void saveImage(final BufferedImage image, + final String fileName) { + try { + ImageIO.write(image, + "png", + new File(fileName + ".png")); + } catch (IOException ignored) { + } + } +} From 096b7ff0977ba2455b329b0865a380a1fb4c99d4 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Wed, 23 Aug 2023 15:31:33 +0000 Subject: [PATCH 154/162] 8314810: (fs) java/nio/file/Files/CopyInterference.java should use TestUtil::supportsLinks Reviewed-by: aturbanov, alanb --- .../java/nio/file/Files/CopyInterference.java | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/test/jdk/java/nio/file/Files/CopyInterference.java b/test/jdk/java/nio/file/Files/CopyInterference.java index a9319900dc5..310d3e382ca 100644 --- a/test/jdk/java/nio/file/Files/CopyInterference.java +++ b/test/jdk/java/nio/file/Files/CopyInterference.java @@ -24,6 +24,8 @@ /* @test * @bug 8114830 * @summary Verify FileAlreadyExistsException is not thrown for REPLACE_EXISTING + * @library .. + * @build CopyInterference * @run junit CopyInterference */ import java.io.InputStream; @@ -112,17 +114,22 @@ private static Stream pathAndOptionsProvider() new CopyOption[] {REPLACE_EXISTING}); list.add(args); - // symblic link, followed - Path link = dir.resolve("link"); - Files.createSymbolicLink(link, sourceFile); - args = Arguments.of(link, dir.resolve("linkFollowed"), - new CopyOption[] {REPLACE_EXISTING}); - list.add(args); - - // symblic link, not followed - args = Arguments.of(link, dir.resolve("linkNotFollowed"), - new CopyOption[] {REPLACE_EXISTING, NOFOLLOW_LINKS}); - list.add(args); + if (TestUtil.supportsLinks(dir)) { + // symbolic link, followed + Path link = dir.resolve("link"); + Files.createSymbolicLink(link, sourceFile); + args = Arguments.of(link, dir.resolve("linkFollowed"), + new CopyOption[] {REPLACE_EXISTING}); + list.add(args); + + // symbolic link, not followed + args = Arguments.of(link, dir.resolve("linkNotFollowed"), + new CopyOption[] {REPLACE_EXISTING, + NOFOLLOW_LINKS}); + list.add(args); + } else { + System.out.println("Links not supported: not testing links"); + } return list.stream(); } From fae3b02aeb6fbb34b4b3d2e669761cf7f9af3613 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Wed, 23 Aug 2023 17:36:46 +0000 Subject: [PATCH 155/162] 8314746: Remove unused private put* methods from DirectByteBufferR Reviewed-by: alanb, bpb --- .../classes/java/nio/Direct-X-Buffer-bin.java.template | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template b/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template index 4a281453886..edfdaa218bf 100644 --- a/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template +++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer-bin.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,8 +58,8 @@ class XXX { #end[rw] - private ByteBuffer put$Type$(long a, $type$ x) { #if[rw] + private ByteBuffer put$Type$(long a, $type$ x) { try { $memtype$ y = $toBits$(x); SCOPED_MEMORY_ACCESS.put$Memtype$Unaligned(session(), null, a, y, bigEndian); @@ -67,10 +67,8 @@ class XXX { Reference.reachabilityFence(this); } return this; -#else[rw] - throw new ReadOnlyBufferException(); -#end[rw] } +#end[rw] public ByteBuffer put$Type$($type$ x) { #if[rw] From dbb788f34dbbe0aa5c8356fb4a5dc19b96787d25 Mon Sep 17 00:00:00 2001 From: "lawrence.andrews" Date: Wed, 23 Aug 2023 17:48:07 +0000 Subject: [PATCH 156/162] 8294535: Add screen capture functionality to PassFailJFrame Co-authored-by: Alexey Ivanov Reviewed-by: aivanov, honkar --- .../awt/regtesthelpers/PassFailJFrame.java | 228 +++++++++++++++++- 1 file changed, 223 insertions(+), 5 deletions(-) diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index a13d6ee2e08..92ff9371933 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,31 +21,44 @@ * questions. */ +import java.awt.AWTException; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; +import java.awt.Image; import java.awt.Insets; import java.awt.Rectangle; +import java.awt.Robot; import java.awt.Toolkit; import java.awt.Window; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.awt.image.RenderedImage; +import java.io.File; +import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +import javax.imageio.ImageIO; import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.Timer; - import static javax.swing.SwingUtilities.invokeAndWait; import static javax.swing.SwingUtilities.isEventDispatchThread; @@ -68,7 +81,9 @@ public class PassFailJFrame { private static volatile boolean failed; private static volatile boolean timeout; private static volatile String testFailedReason; + private static final AtomicInteger imgCounter = new AtomicInteger(0); private static JFrame frame; + private static Robot robot; public enum Position {HORIZONTAL, VERTICAL, TOP_LEFT_CORNER} @@ -114,16 +129,62 @@ public PassFailJFrame(String title, String instructions, public PassFailJFrame(String title, String instructions, long testTimeOut, int rows, int columns) throws InterruptedException, InvocationTargetException { + this(title, instructions, testTimeOut, rows, columns, false); + } + + /** + * Constructs a JFrame with a given title & serves as test instructional + * frame where the user follows the specified test instruction in order + * to test the test case & mark the test pass or fail. If the expected + * result is seen then the user click on the 'Pass' button else click + * on the 'Fail' button and the reason for the failure should be + * specified in the JDialog JTextArea. + *

    + * The test instruction frame also provides a way for the tester to take + * a screenshot (full screen or individual frame) if this feature + * is enabled by passing {@code true} as {@code enableScreenCapture} + * parameter. + * + * @param title title of the Frame. + * @param instructions the instruction for the tester on how to test + * and what is expected (pass) and what is not + * expected (fail). + * @param testTimeOut test timeout where time is specified in minutes. + * @param rows number of visible rows of the JTextArea where the + * instruction is show. + * @param columns Number of columns of the instructional + * JTextArea + * @param enableScreenCapture if set to true, 'Capture Screen' button & its + * associated UIs are added to test instruction + * frame + * @throws InterruptedException exception thrown when thread is + * interrupted + * @throws InvocationTargetException if an exception is thrown while + * creating the test instruction frame on + * EDT + */ + public PassFailJFrame(String title, String instructions, long testTimeOut, + int rows, int columns, + boolean enableScreenCapture) throws InterruptedException, + InvocationTargetException { if (isEventDispatchThread()) { - createUI(title, instructions, testTimeOut, rows, columns); + createUI(title, instructions, testTimeOut, rows, columns, + enableScreenCapture); } else { invokeAndWait(() -> createUI(title, instructions, testTimeOut, - rows, columns)); + rows, columns, enableScreenCapture)); } } + private PassFailJFrame(Builder builder) throws InterruptedException, + InvocationTargetException { + this(builder.title, builder.instructions, builder.testTimeOut, + builder.rows, builder.columns, builder.screenCapture); + } + private static void createUI(String title, String instructions, - long testTimeOut, int rows, int columns) { + long testTimeOut, int rows, int columns, + boolean enableScreenCapture) { frame = new JFrame(title); frame.setLayout(new BorderLayout()); JTextArea instructionsText = new JTextArea(instructions, rows, columns); @@ -167,6 +228,10 @@ private static void createUI(String title, String instructions, buttonsPanel.add(btnPass); buttonsPanel.add(btnFail); + if (enableScreenCapture) { + buttonsPanel.add(createCapturePanel()); + } + frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { @@ -184,6 +249,91 @@ public void windowClosing(WindowEvent e) { windowList.add(frame); } + private static JComponent createCapturePanel() { + JComboBox screenShortType = new JComboBox<>(CaptureType.values()); + + JButton capture = new JButton("ScreenShot"); + capture.addActionListener((e) -> + captureScreen((CaptureType) screenShortType.getSelectedItem())); + + JPanel panel = new JPanel(); + panel.add(screenShortType); + panel.add(capture); + return panel; + } + + private enum CaptureType { + FULL_SCREEN("Capture Full Screen"), + WINDOWS("Capture Individual Frame"); + + private final String type; + CaptureType(String type) { + this.type = type; + } + + @Override + public String toString() { + return type; + } + } + + private static Robot createRobot() { + if (robot == null) { + try { + robot = new Robot(); + } catch (AWTException e) { + String errorMsg = "Failed to create an instance of Robot."; + JOptionPane.showMessageDialog(frame, errorMsg, "Failed", + JOptionPane.ERROR_MESSAGE); + forceFail(errorMsg + e.getMessage()); + } + } + return robot; + } + + private static void captureScreen(Rectangle bounds) { + Robot robot = createRobot(); + + List imageList = robot.createMultiResolutionScreenCapture(bounds) + .getResolutionVariants(); + Image image = imageList.get(imageList.size() - 1); + + File file = new File("CaptureScreen_" + + imgCounter.incrementAndGet() + ".png"); + try { + ImageIO.write((RenderedImage) image, "png", file); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static void captureScreen(CaptureType type) { + switch (type) { + case FULL_SCREEN: + Arrays.stream(GraphicsEnvironment.getLocalGraphicsEnvironment() + .getScreenDevices()) + .map(GraphicsDevice::getDefaultConfiguration) + .map(GraphicsConfiguration::getBounds) + .forEach(PassFailJFrame::captureScreen); + break; + + case WINDOWS: + windowList.stream() + .filter(Window::isShowing) + .map(Window::getBounds) + .forEach(PassFailJFrame::captureScreen); + break; + + default: + throw new IllegalStateException("Unexpected value of capture type"); + } + + JOptionPane.showMessageDialog(frame, + "Screen Captured Successfully", + "Screen Capture", + JOptionPane.INFORMATION_MESSAGE); + } + private static String convertMillisToTimeStr(long millis) { if (millis < 0) { return "00:00:00"; @@ -421,4 +571,72 @@ public static void forceFail(String reason) { testFailedReason = FAILURE_REASON + reason; latch.countDown(); } + + public static class Builder { + private String title; + private String instructions; + private long testTimeOut; + private int rows; + private int columns; + private boolean screenCapture = false; + + public Builder title(String title) { + this.title = title; + return this; + } + + public Builder instructions(String instructions) { + this.instructions = instructions; + return this; + } + + public Builder testTimeOut(long testTimeOut) { + this.testTimeOut = testTimeOut; + return this; + } + + public Builder rows(int rows) { + this.rows = rows; + return this; + } + + public Builder columns(int columns) { + this.columns = columns; + return this; + } + + public Builder screenCapture() { + this.screenCapture = true; + return this; + } + + public PassFailJFrame build() throws InterruptedException, + InvocationTargetException { + validate(); + return new PassFailJFrame(this); + } + + private void validate() { + if (this.title == null) { + this.title = TITLE; + } + + if (this.instructions == null || this.instructions.length() == 0) { + throw new RuntimeException("Please provide the test " + + "instruction for this manual test"); + } + + if (this.testTimeOut == 0L) { + this.testTimeOut = TEST_TIMEOUT; + } + + if (this.rows == 0) { + this.rows = ROWS; + } + + if (this.columns == 0) { + this.columns = COLUMNS; + } + } + } } From 9435cd19165c9ffc3f19fd423f3706b1e37212d8 Mon Sep 17 00:00:00 2001 From: Ben Perez Date: Wed, 23 Aug 2023 18:10:11 +0000 Subject: [PATCH 157/162] 8175874: Update Security.insertProviderAt to specify behavior when requested position is out of range. Reviewed-by: mullan, valeriep --- .../share/classes/java/security/Security.java | 5 ++++- .../java/security/Provider/ChangeProviders.java | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/java/security/Security.java b/src/java.base/share/classes/java/security/Security.java index 671529f71a1..0cdd22340df 100644 --- a/src/java.base/share/classes/java/security/Security.java +++ b/src/java.base/share/classes/java/security/Security.java @@ -296,7 +296,10 @@ public static String getAlgorithmProperty(String algName, * Adds a new provider, at a specified position. The position is * the preference order in which providers are searched for * requested algorithms. The position is 1-based, that is, - * 1 is most preferred, followed by 2, and so on. + * 1 is most preferred, followed by 2, and so on. If the position + * is less than 1 or greater than n, where n is the number of installed + * providers, the provider (if not already installed) is inserted at + * the end of the list, or at the n + 1 position. * *

    If the given provider is installed at the requested position, * the provider that used to be at that position, and all providers diff --git a/test/jdk/java/security/Provider/ChangeProviders.java b/test/jdk/java/security/Provider/ChangeProviders.java index 2c699cd70b1..4b8b2cb48c9 100644 --- a/test/jdk/java/security/Provider/ChangeProviders.java +++ b/test/jdk/java/security/Provider/ChangeProviders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 4856968 7054918 8130181 + * @bug 4856968 7054918 8130181 8175874 * @library ../testlibrary * @summary make sure add/insert/removeProvider() work correctly * @author Andreas Sterbenz @@ -81,6 +81,19 @@ public static void main0(String[] args) throws Exception { throw new Exception("Provider not at pos 1"); } + // Ensure that providers inserted at positions outside of [1..n] are placed + // at the n+1st position + Security.removeProvider(p.getName()); + Security.insertProviderAt(p, 0); + if (plen() != n + 1 || Security.getProviders()[n] != p) { + throw new Exception("Provider inserted at zero not at pos n+1"); + } + Security.removeProvider(p.getName()); + Security.insertProviderAt(p, n + 5); + if (plen() != n + 1 || Security.getProviders()[n] != p) { + throw new Exception("Provider inserted at n+5 not at pos n+1"); + } + System.out.println("All tests passed."); } From 2c60cadfde61363d1f5aefdcf138e039a461c914 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Wed, 23 Aug 2023 19:12:35 +0000 Subject: [PATCH 158/162] 8280743: HSDB "Monitor Cache Dump" command might throw NPE Reviewed-by: kevinw, sspitsyn --- .../sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java index 9f6ec170d86..ed3ccb2c496 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,8 +67,12 @@ private static void dumpMonitor(PrintStream tty, ObjectMonitor mon, boolean raw) tty.println(); tty.println(" _header: 0x" + Long.toHexString(mon.header().value())); OopHandle obj = mon.object(); - Oop oop = heap.newOop(obj); - tty.println(" _object: " + obj + ", a " + oop.getKlass().getName().asString()); + if (obj == null) { + tty.println(" _object: null"); + } else { + Oop oop = heap.newOop(obj); + tty.println(" _object: " + obj + ", a " + oop.getKlass().getName().asString()); + } Address owner = mon.owner(); tty.println(" _owner: " + owner); if (!raw && owner != null) { From 38a9edfb7ee2d91ff52074137c5b69e27bcdbdc3 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Wed, 23 Aug 2023 20:11:10 +0000 Subject: [PATCH 159/162] 8314679: SA fails to properly attach to JVM after having just detached from a different JVM Reviewed-by: dholmes, kevinw --- .../sun/jvm/hotspot/memory/FileMapInfo.java | 4 +- .../jtreg/ProblemList-generational-zgc.txt | 1 + .../sa/ClhsdbAttachDifferentJVMs.java | 91 +++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/serviceability/sa/ClhsdbAttachDifferentJVMs.java diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java index 33621a06029..3dfb2bc5d10 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,6 +83,8 @@ static Address get_CDSFileMapRegion(Type FileMapHeader_type, Address header, int } private static void initialize(TypeDataBase db) { + vTableTypeMap = null; // force vTableTypeMap to get re-initialized later + Type FileMapInfo_type = db.lookupType("FileMapInfo"); Type FileMapHeader_type = db.lookupType("FileMapHeader"); Type CDSFileMapRegion_type = db.lookupType("CDSFileMapRegion"); diff --git a/test/hotspot/jtreg/ProblemList-generational-zgc.txt b/test/hotspot/jtreg/ProblemList-generational-zgc.txt index de22024f8d7..b5c35f2cec2 100644 --- a/test/hotspot/jtreg/ProblemList-generational-zgc.txt +++ b/test/hotspot/jtreg/ProblemList-generational-zgc.txt @@ -32,6 +32,7 @@ resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java 8307393 generic-all serviceability/sa/CDSJMapClstats.java 8307393 generic-all serviceability/sa/ClhsdbAttach.java 8307393 generic-all +serviceability/sa/ClhsdbAttachDifferentJVMs.java 8307393 generic-all serviceability/sa/ClhsdbCDSCore.java 8307393 generic-all serviceability/sa/ClhsdbCDSJstackPrintAll.java 8307393 generic-all serviceability/sa/ClhsdbClasses.java 8307393 generic-all diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbAttachDifferentJVMs.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbAttachDifferentJVMs.java new file mode 100644 index 00000000000..1ed59b66429 --- /dev/null +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbAttachDifferentJVMs.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jdk.test.lib.apps.LingeredApp; +import jtreg.SkippedException; + +/** + * @test + * @bug 8314679 + * @summary Test clhsdb attach, detach, and then attach to different JVM + * @requires vm.hasSA + * @library /test/lib + * @run main/othervm ClhsdbAttachDifferentJVMs + */ + +public class ClhsdbAttachDifferentJVMs { + + public static void main(String[] args) throws Exception { + System.out.println("Starting ClhsdbAttach test"); + + LingeredApp theApp1 = null; + LingeredApp theApp2 = null; + try { + ClhsdbLauncher test = new ClhsdbLauncher(); + theApp1 = LingeredApp.startApp(); + System.out.println("Started LingeredApp with pid " + theApp1.getPid()); + theApp2 = LingeredApp.startApp(); + System.out.println("Started LingeredApp with pid " + theApp2.getPid()); + String attach1 = "attach " + theApp1.getPid(); + String attach2 = "attach " + theApp2.getPid(); + + List cmds = List.of( + "where", + attach1, + "threads", + "detach", + attach2, + "jstack"); + + Map> expStrMap = new HashMap<>(); + expStrMap.put("where", List.of( + "Command not valid until attached to a VM")); + expStrMap.put(attach1, List.of( + "Attaching to process " + theApp1.getPid())); + expStrMap.put("threads", List.of( + "Reference Handler")); + expStrMap.put(attach2, List.of( + "Attaching to process " + theApp2.getPid())); + expStrMap.put("jstack", List.of( + "Reference Handler")); + + Map> unexpStrMap = new HashMap<>(); + unexpStrMap.put("jstack", List.of( + "WARNING")); + + test.run(-1, cmds, expStrMap, unexpStrMap); + } catch (SkippedException se) { + throw se; + } catch (Exception ex) { + throw new RuntimeException("Test ERROR " + ex, ex); + } finally { + LingeredApp.stopApp(theApp1); + LingeredApp.stopApp(theApp2); + } + System.out.println("Test PASSED"); + } +} From 57a322da9bf6aac98e834516728fb6da1c18e7aa Mon Sep 17 00:00:00 2001 From: Alexander Matveev Date: Wed, 23 Aug 2023 20:22:12 +0000 Subject: [PATCH 160/162] 8308042: [macos] Developer ID Application Certificate not picked up by jpackage if it contains UNICODE characters Reviewed-by: asemenyuk --- .../jdk/jpackage/internal/MacAppBundler.java | 6 +- .../internal/MacBaseInstallerBundler.java | 42 ---- .../jdk/jpackage/internal/MacCertificate.java | 221 ++++++++++++++++-- .../jdk/jpackage/internal/MacPkgBundler.java | 4 +- .../jpackage/macosx/SigningAppImageTest.java | 30 ++- .../macosx/SigningAppImageTwoStepsTest.java | 17 +- ...SigningPackageFromTwoStepAppImageTest.java | 25 +- .../jpackage/macosx/SigningPackageTest.java | 26 ++- .../macosx/SigningPackageTwoStepTest.java | 20 +- .../jpackage/macosx/base/SigningBase.java | 107 ++++++--- .../jpackage/macosx/base/SigningCheck.java | 82 +++---- 11 files changed, 384 insertions(+), 196 deletions(-) diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java index 4cf697f4f35..cf031cb47a5 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,13 +62,13 @@ public MacAppBundler() { String keychain = SIGNING_KEYCHAIN.fetchFrom(params); String result = null; if (APP_STORE.fetchFrom(params)) { - result = MacBaseInstallerBundler.findKey( + result = MacCertificate.findCertificateKey( "3rd Party Mac Developer Application: ", user, keychain); } // if either not signing for app store or couldn't find if (result == null) { - result = MacBaseInstallerBundler.findKey( + result = MacCertificate.findCertificateKey( "Developer ID Application: ", user, keychain); } diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java index 31bef8416fc..b4f63d66f57 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java @@ -207,47 +207,5 @@ public String getBundleType() { return "INSTALLER"; } - public static String findKey(String keyPrefix, String teamName, String keychainName) { - - boolean useAsIs = teamName.startsWith(keyPrefix) - || teamName.startsWith("Developer ID") - || teamName.startsWith("3rd Party Mac"); - - String key = (useAsIs) ? teamName : (keyPrefix + teamName); - - try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(baos)) { - List searchOptions = new ArrayList<>(); - searchOptions.add("/usr/bin/security"); - searchOptions.add("find-certificate"); - searchOptions.add("-c"); - searchOptions.add(key); - searchOptions.add("-a"); - if (keychainName != null && !keychainName.isEmpty()) { - searchOptions.add(keychainName); - } - - ProcessBuilder pb = new ProcessBuilder(searchOptions); - - IOUtils.exec(pb, false, ps); - Pattern p = Pattern.compile("\"alis\"=\"([^\"]+)\""); - Matcher m = p.matcher(baos.toString()); - if (!m.find()) { - Log.error(MessageFormat.format(I18N.getString( - "error.cert.not.found"), key, keychainName)); - return null; - } - String matchedKey = m.group(1); - if (m.find()) { - Log.error(MessageFormat.format(I18N.getString( - "error.multiple.certs.found"), key, keychainName)); - } - return matchedKey; - } catch (IOException ioe) { - Log.verbose(ioe); - return null; - } - } - private final Bundler appImageBundler; } diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacCertificate.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacCertificate.java index 4e205fd9705..90f3a8c765b 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacCertificate.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacCertificate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.text.DateFormat; +import java.text.MessageFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -40,6 +41,9 @@ import java.util.Date; import java.util.List; import java.util.Locale; +import java.util.HexFormat; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public final class MacCertificate { private final String certificate; @@ -52,35 +56,219 @@ public boolean isValid() { return verifyCertificate(this.certificate); } - private static Path findCertificate(String certificate) { - Path result = null; + public static String findCertificateKey(String keyPrefix, String teamName, + String keychainName) { + String matchedKey = null; + boolean useAsIs = (keyPrefix == null) + || teamName.startsWith(keyPrefix) + || teamName.startsWith("Developer ID") + || teamName.startsWith("3rd Party Mac"); + + String name = (useAsIs) ? teamName : (keyPrefix + teamName); + + String output = getFindCertificateOutput(name, keychainName); + if (output == null) { + Log.error(MessageFormat.format(I18N.getString( + "error.cert.not.found"), name, keychainName)); + return null; + } + + // Check and warn user if multiple certificates found + // We will use different regex to count certificates. + // ASCII case: "alis"="NAME" + // UNICODE case: "alis"=0xSOMEHEXDIGITS "NAME (\SOMEDIGITS)" + // In UNICODE case name will contain octal sequence representing UTF-8 + // characters. + // Just look for at least two '"alis"'. + Pattern p = Pattern.compile("\"alis\""); + Matcher m = p.matcher(output); + if (m.find() && m.find()) { + Log.error(MessageFormat.format(I18N.getString( + "error.multiple.certs.found"), name, keychainName)); + } + + // Try to get ASCII only certificate first. This aproach only works + // if certificate name has ASCII only characters in name. For certificates + // with UNICODE characters in name we will use combination of "security" + // and "openssl". We keeping ASCII only aproach to avoid regressions and + // it works for many use cases. + p = Pattern.compile("\"alis\"=\"([^\"]+)\""); + m = p.matcher(output); + if (m.find()) { + matchedKey = m.group(1);; + } + + // Maybe it has UNICODE characters in name. In this case use "security" + // and "openssl" to exctract name. We cannot use just "security", since + // name can be truncated. + if (matchedKey == null) { + Path file = null; + try { + file = getFindCertificateOutputPEM(name, keychainName); + if (file != null) { + matchedKey = findCertificateSubject( + file.toFile().getCanonicalPath()); + } + } catch (IOException ioe) { + Log.verbose(ioe); + } finally { + try { + Files.deleteIfExists(file); + } catch (IOException ignored) {} + } + } + + if (matchedKey == null) { + Log.error(MessageFormat.format(I18N.getString( + "error.cert.not.found"), name, keychainName)); + } + + return matchedKey; + } + + private static String getFindCertificateOutput(String name, + String keychainName) { + try (ByteArrayOutputStream baos = getFindCertificateOutput(name, + keychainName, + false)) { + if (baos != null) { + return baos.toString(); + } + } catch (IOException ioe) { + Log.verbose(ioe); + } + + return null; + } + + private static Path getFindCertificateOutputPEM(String name, + String keychainName) { + Path output = null; + try (ByteArrayOutputStream baos = getFindCertificateOutput(name, + keychainName, + true)) { + if (baos != null) { + output = Files.createTempFile("tempfile", ".tmp"); + Files.copy(new ByteArrayInputStream(baos.toByteArray()), + output, StandardCopyOption.REPLACE_EXISTING); + return output; + } + } catch (IOException ioe) { + Log.verbose(ioe); + try { + Files.deleteIfExists(output); + } catch (IOException ignored) {} + } + + return null; + } + + private static ByteArrayOutputStream getFindCertificateOutput(String name, + String keychainName, + boolean isPEMFormat) { List args = new ArrayList<>(); args.add("/usr/bin/security"); args.add("find-certificate"); args.add("-c"); - args.add(certificate); + args.add(name); args.add("-a"); - args.add("-p"); + if (isPEMFormat) { + args.add("-p"); + } + if (keychainName != null && !keychainName.isEmpty()) { + args.add(keychainName); + } + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (PrintStream ps = new PrintStream(baos)) { + ProcessBuilder pb = new ProcessBuilder(args); + IOUtils.exec(pb, false, ps); + return baos; + } catch (IOException ioe) { + Log.verbose(ioe); + return null; + } + } + + private static String findCertificateSubject(String filename) { + String result = null; + + List args = new ArrayList<>(); + args.add("/usr/bin/openssl"); + args.add("x509"); + args.add("-noout"); + args.add("-subject"); + args.add("-in"); + args.add(filename); try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos)) { ProcessBuilder security = new ProcessBuilder(args); IOUtils.exec(security, false, ps); + String output = baos.toString().strip(); + // Example output: + // subject= /UID=ABCDABCD/CN=jpackage.openjdk.java.net (\xC3\xB6) (ABCDABCD)/C=US + // We need 'CN' value + String [] pairs = output.split("/"); + for (String pair : pairs) { + if (pair.startsWith("CN=")) { + result = pair.substring(3); + // Convert escaped UTF-8 code points to characters + result = convertHexToChar(result); + break; + } + } + } catch (IOException ex) { + Log.verbose(ex); + } - Path output = Files.createTempFile("tempfile", ".tmp"); + return result; + } - Files.copy(new ByteArrayInputStream(baos.toByteArray()), - output, StandardCopyOption.REPLACE_EXISTING); + // Certificate name with Unicode will be: + // Developer ID Application: jpackage.openjdk.java.net (\xHH\xHH) + // Convert UTF-8 code points '\xHH\xHH' to character. + private static String convertHexToChar(String input) { + if (input == null || input.isEmpty()) { + return input; + } - result = output; + if (!input.contains("\\x")) { + return input; } - catch (IOException ignored) {} - return result; + StringBuilder output = new StringBuilder(); + try { + int len = input.length(); + for (int i = 0; i < len; i++) { + if (input.codePointAt(i) == '\\' && + (i + 8) <= len && + input.codePointAt(i + 1) == 'x' && + input.codePointAt(i + 4) == '\\' && + input.codePointAt(i + 5) == 'x') { + // We found '\xHH\xHH' + // HEX code points to byte array + byte [] bytes = HexFormat.of().parseHex( + input.substring(i + 2, i + 4) + input.substring(i + 6, i + 8)); + // Byte array with UTF-8 code points to character + output.append(new String(bytes, "UTF-8")); + i += 7; // Skip '\xHH\xHH' + } else { + output.appendCodePoint(input.codePointAt(i)); + } + } + } catch (Exception ex) { + Log.verbose(ex); + // We will consider any excpetions during conversion as + // certificate not found. + return null; + } + + return output.toString(); } - private static Date findCertificateDate(String filename) { + private Date findCertificateDate(String filename) { Date result = null; List args = new ArrayList<>(); @@ -107,7 +295,7 @@ private static Date findCertificateDate(String filename) { return result; } - private static boolean verifyCertificate(String certificate) { + private boolean verifyCertificate(String certificate) { boolean result = false; try { @@ -115,16 +303,15 @@ private static boolean verifyCertificate(String certificate) { Date certificateDate = null; try { - file = findCertificate(certificate); + file = getFindCertificateOutputPEM(certificate, null); if (file != null) { certificateDate = findCertificateDate( file.toFile().getCanonicalPath()); } - } - finally { + } finally { if (file != null) { - Files.delete(file); + Files.deleteIfExists(file); } } diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java index 034c8013b70..60cd11b6f06 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java @@ -110,13 +110,13 @@ public class MacPkgBundler extends MacBaseInstallerBundler { String keychain = SIGNING_KEYCHAIN.fetchFrom(params); String result = null; if (APP_STORE.fetchFrom(params)) { - result = MacBaseInstallerBundler.findKey( + result = MacCertificate.findCertificateKey( "3rd Party Mac Developer Installer: ", user, keychain); } // if either not signing for app store or couldn't find if (result == null) { - result = MacBaseInstallerBundler.findKey( + result = MacCertificate.findCertificateKey( "Developer ID Installer: ", user, keychain); } diff --git a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java index 53ce1152c6f..6cea5ebd332 100644 --- a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,31 +61,37 @@ public class SigningAppImageTest { @Test - @Parameter("true") - @Parameter("false") - public void test(boolean doSign) throws Exception { - SigningCheck.checkCertificates(); + @Parameter({"true", "0"}) // ({"sign or not", "certificate index"}) + @Parameter({"true", "1"}) + @Parameter({"false", "-1"}) + public void test(String... testArgs) throws Exception { + boolean doSign = Boolean.parseBoolean(testArgs[0]); + int certIndex = Integer.parseInt(testArgs[1]); + + SigningCheck.checkCertificates(certIndex); JPackageCommand cmd = JPackageCommand.helloAppImage(); if (doSign) { - cmd.addArguments("--mac-sign", "--mac-signing-key-user-name", - SigningBase.DEV_NAME, "--mac-signing-keychain", - SigningBase.KEYCHAIN); + cmd.addArguments("--mac-sign", + "--mac-signing-key-user-name", + SigningBase.getDevName(certIndex), + "--mac-signing-keychain", + SigningBase.getKeyChain()); } AdditionalLauncher testAL = new AdditionalLauncher("testAL"); testAL.applyTo(cmd); cmd.executeAndAssertHelloAppImageCreated(); Path launcherPath = cmd.appLauncherPath(); - SigningBase.verifyCodesign(launcherPath, doSign); + SigningBase.verifyCodesign(launcherPath, doSign, certIndex); Path testALPath = launcherPath.getParent().resolve("testAL"); - SigningBase.verifyCodesign(testALPath, doSign); + SigningBase.verifyCodesign(testALPath, doSign, certIndex); Path appImage = cmd.outputBundle(); - SigningBase.verifyCodesign(appImage, doSign); + SigningBase.verifyCodesign(appImage, doSign, certIndex); if (doSign) { - SigningBase.verifySpctl(appImage, "exec"); + SigningBase.verifySpctl(appImage, "exec", certIndex); } } } diff --git a/test/jdk/tools/jpackage/macosx/SigningAppImageTwoStepsTest.java b/test/jdk/tools/jpackage/macosx/SigningAppImageTwoStepsTest.java index e6dc7a6b49c..b5d1030ab95 100644 --- a/test/jdk/tools/jpackage/macosx/SigningAppImageTwoStepsTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningAppImageTwoStepsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,7 +65,7 @@ public class SigningAppImageTwoStepsTest { @Parameter("true") @Parameter("false") public void test(boolean signAppImage) throws Exception { - SigningCheck.checkCertificates(); + SigningCheck.checkCertificates(SigningBase.DEFAULT_INDEX); Path appimageOutput = TKit.createTempDirectory("appimage"); @@ -75,9 +75,11 @@ public void test(boolean signAppImage) throws Exception { JPackageCommand appImageCmd = JPackageCommand.helloAppImage() .setArgumentValue("--dest", appimageOutput); if (signAppImage) { - appImageCmd.addArguments("--mac-sign", "--mac-signing-key-user-name", - SigningBase.DEV_NAME, "--mac-signing-keychain", - SigningBase.KEYCHAIN); + appImageCmd.addArguments("--mac-sign", + "--mac-signing-key-user-name", + SigningBase.getDevName(SigningBase.DEFAULT_INDEX), + "--mac-signing-keychain", + SigningBase.getKeyChain()); } // Add addtional launcher @@ -95,8 +97,9 @@ public void test(boolean signAppImage) throws Exception { cmd.setPackageType(PackageType.IMAGE) .addArguments("--app-image", appImageCmd.outputBundle().toAbsolutePath()) .addArguments("--mac-sign") - .addArguments("--mac-signing-key-user-name", SigningBase.DEV_NAME) - .addArguments("--mac-signing-keychain", SigningBase.KEYCHAIN); + .addArguments("--mac-signing-key-user-name", + SigningBase.getDevName(SigningBase.DEFAULT_INDEX)) + .addArguments("--mac-signing-keychain", SigningBase.getKeyChain()); cmd.executeAndAssertImageCreated(); // Should be signed app image diff --git a/test/jdk/tools/jpackage/macosx/SigningPackageFromTwoStepAppImageTest.java b/test/jdk/tools/jpackage/macosx/SigningPackageFromTwoStepAppImageTest.java index 29b4ec50bc6..861bcecfe09 100644 --- a/test/jdk/tools/jpackage/macosx/SigningPackageFromTwoStepAppImageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningPackageFromTwoStepAppImageTest.java @@ -72,8 +72,8 @@ private static void verifyPKG(JPackageCommand cmd) { } Path outputBundle = cmd.outputBundle(); - SigningBase.verifyPkgutil(outputBundle); - SigningBase.verifySpctl(outputBundle, "install"); + SigningBase.verifyPkgutil(outputBundle, SigningBase.DEFAULT_INDEX); + SigningBase.verifySpctl(outputBundle, "install", SigningBase.DEFAULT_INDEX); } private static void verifyDMG(JPackageCommand cmd) { @@ -89,9 +89,9 @@ private static void verifyAppImageInDMG(JPackageCommand cmd) { if (dmgImage.endsWith(cmd.name() + ".app")) { Path launcherPath = ApplicationLayout.platformAppImage() .resolveAt(dmgImage).launchersDirectory().resolve(cmd.name()); - SigningBase.verifyCodesign(launcherPath, true); - SigningBase.verifyCodesign(dmgImage, true); - SigningBase.verifySpctl(dmgImage, "exec"); + SigningBase.verifyCodesign(launcherPath, true, SigningBase.DEFAULT_INDEX); + SigningBase.verifyCodesign(dmgImage, true, SigningBase.DEFAULT_INDEX); + SigningBase.verifySpctl(dmgImage, "exec", SigningBase.DEFAULT_INDEX); } }); } @@ -100,7 +100,7 @@ private static void verifyAppImageInDMG(JPackageCommand cmd) { @Parameter("true") @Parameter("false") public static void test(boolean signAppImage) throws Exception { - SigningCheck.checkCertificates(); + SigningCheck.checkCertificates(SigningBase.DEFAULT_INDEX); Path appimageOutput = TKit.createTempDirectory("appimage"); @@ -111,8 +111,8 @@ public static void test(boolean signAppImage) throws Exception { .setArgumentValue("--dest", appimageOutput); if (signAppImage) { appImageCmd.addArguments("--mac-sign", "--mac-signing-key-user-name", - SigningBase.DEV_NAME, "--mac-signing-keychain", - SigningBase.KEYCHAIN); + SigningBase.getDevName(SigningBase.DEFAULT_INDEX), + "--mac-signing-keychain", SigningBase.getKeyChain()); } // Generate app image @@ -126,8 +126,9 @@ public static void test(boolean signAppImage) throws Exception { appImageSignedCmd.setPackageType(PackageType.IMAGE) .addArguments("--app-image", appImageCmd.outputBundle().toAbsolutePath()) .addArguments("--mac-sign") - .addArguments("--mac-signing-key-user-name", SigningBase.DEV_NAME) - .addArguments("--mac-signing-keychain", SigningBase.KEYCHAIN); + .addArguments("--mac-signing-key-user-name", + SigningBase.getDevName(SigningBase.DEFAULT_INDEX)) + .addArguments("--mac-signing-keychain", SigningBase.getKeyChain()); appImageSignedCmd.executeAndAssertImageCreated(); // Should be signed app image @@ -141,9 +142,9 @@ public static void test(boolean signAppImage) throws Exception { if (signAppImage) { cmd.addArguments("--mac-sign", "--mac-signing-key-user-name", - SigningBase.DEV_NAME, + SigningBase.getDevName(SigningBase.DEFAULT_INDEX), "--mac-signing-keychain", - SigningBase.KEYCHAIN); + SigningBase.getKeyChain()); } }) .forTypes(PackageType.MAC_PKG) diff --git a/test/jdk/tools/jpackage/macosx/SigningPackageTest.java b/test/jdk/tools/jpackage/macosx/SigningPackageTest.java index e7bb97784a5..d7a2395db2a 100644 --- a/test/jdk/tools/jpackage/macosx/SigningPackageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningPackageTest.java @@ -28,6 +28,7 @@ import jdk.jpackage.test.PackageType; import jdk.jpackage.test.MacHelper; import jdk.jpackage.test.Annotations.Test; +import jdk.jpackage.test.Annotations.Parameter; /** * Tests generation of dmg and pkg with --mac-sign and related arguments. @@ -65,8 +66,8 @@ public class SigningPackageTest { private static void verifyPKG(JPackageCommand cmd) { Path outputBundle = cmd.outputBundle(); - SigningBase.verifyPkgutil(outputBundle); - SigningBase.verifySpctl(outputBundle, "install"); + SigningBase.verifyPkgutil(outputBundle, getCertIndex(cmd)); + SigningBase.verifySpctl(outputBundle, "install", getCertIndex(cmd)); } private static void verifyDMG(JPackageCommand cmd) { @@ -81,24 +82,31 @@ private static void verifyAppImageInDMG(JPackageCommand cmd) { // We will be called with all folders in DMG since JDK-8263155, but // we only need to verify app. if (dmgImage.endsWith(cmd.name() + ".app")) { - SigningBase.verifyCodesign(launcherPath, true); - SigningBase.verifyCodesign(dmgImage, true); - SigningBase.verifySpctl(dmgImage, "exec"); + SigningBase.verifyCodesign(launcherPath, true, getCertIndex(cmd)); + SigningBase.verifyCodesign(dmgImage, true, getCertIndex(cmd)); + SigningBase.verifySpctl(dmgImage, "exec", getCertIndex(cmd)); } }); } + private static int getCertIndex(JPackageCommand cmd) { + String devName = cmd.getArgumentValue("--mac-signing-key-user-name"); + return SigningBase.getDevNameIndex(devName); + } + @Test - public static void test() throws Exception { - SigningCheck.checkCertificates(); + @Parameter("0") + @Parameter("1") + public static void test(int certIndex) throws Exception { + SigningCheck.checkCertificates(certIndex); new PackageTest() .configureHelloApp() .forTypes(PackageType.MAC) .addInitializer(cmd -> { cmd.addArguments("--mac-sign", - "--mac-signing-key-user-name", SigningBase.DEV_NAME, - "--mac-signing-keychain", SigningBase.KEYCHAIN); + "--mac-signing-key-user-name", SigningBase.getDevName(certIndex), + "--mac-signing-keychain", SigningBase.getKeyChain()); }) .forTypes(PackageType.MAC_PKG) .addBundleVerifier(SigningPackageTest::verifyPKG) diff --git a/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java b/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java index f0442f92af4..66145a9793b 100644 --- a/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningPackageTwoStepTest.java @@ -73,8 +73,8 @@ private static void verifyPKG(JPackageCommand cmd) { } Path outputBundle = cmd.outputBundle(); - SigningBase.verifyPkgutil(outputBundle); - SigningBase.verifySpctl(outputBundle, "install"); + SigningBase.verifyPkgutil(outputBundle, SigningBase.DEFAULT_INDEX); + SigningBase.verifySpctl(outputBundle, "install", SigningBase.DEFAULT_INDEX); } private static void verifyDMG(JPackageCommand cmd) { @@ -91,10 +91,10 @@ private static void verifyAppImageInDMG(JPackageCommand cmd) { boolean isSigned = cmd.hasArgument("--mac-sign"); Path launcherPath = ApplicationLayout.platformAppImage() .resolveAt(dmgImage).launchersDirectory().resolve(cmd.name()); - SigningBase.verifyCodesign(launcherPath, isSigned); - SigningBase.verifyCodesign(dmgImage, isSigned); + SigningBase.verifyCodesign(launcherPath, isSigned, SigningBase.DEFAULT_INDEX); + SigningBase.verifyCodesign(dmgImage, isSigned, SigningBase.DEFAULT_INDEX); if (isSigned) { - SigningBase.verifySpctl(dmgImage, "exec"); + SigningBase.verifySpctl(dmgImage, "exec", SigningBase.DEFAULT_INDEX); } } }); @@ -104,7 +104,7 @@ private static void verifyAppImageInDMG(JPackageCommand cmd) { @Parameter("true") @Parameter("false") public static void test(boolean signAppImage) throws Exception { - SigningCheck.checkCertificates(); + SigningCheck.checkCertificates(0); Path appimageOutput = TKit.createTempDirectory("appimage"); @@ -113,9 +113,9 @@ public static void test(boolean signAppImage) throws Exception { if (signAppImage) { appImageCmd.addArguments("--mac-sign") .addArguments("--mac-signing-key-user-name", - SigningBase.DEV_NAME) + SigningBase.getDevName(0)) .addArguments("--mac-signing-keychain", - SigningBase.KEYCHAIN); + SigningBase.getKeyChain()); } new PackageTest() @@ -127,9 +127,9 @@ public static void test(boolean signAppImage) throws Exception { if (signAppImage) { cmd.addArguments("--mac-sign", "--mac-signing-key-user-name", - SigningBase.DEV_NAME, + SigningBase.getDevName(0), "--mac-signing-keychain", - SigningBase.KEYCHAIN); + SigningBase.getKeyChain()); } }) .forTypes(PackageType.MAC_PKG) diff --git a/test/jdk/tools/jpackage/macosx/base/SigningBase.java b/test/jdk/tools/jpackage/macosx/base/SigningBase.java index cedd0721b25..702e7b1f7ae 100644 --- a/test/jdk/tools/jpackage/macosx/base/SigningBase.java +++ b/test/jdk/tools/jpackage/macosx/base/SigningBase.java @@ -22,6 +22,7 @@ */ import java.nio.file.Path; +import java.util.Arrays; import java.util.List; import jdk.jpackage.test.JPackageCommand; @@ -31,17 +32,53 @@ public class SigningBase { - public static String DEV_NAME; - public static String APP_CERT; - public static String INSTALLER_CERT; - public static String KEYCHAIN; - static { + public static int DEFAULT_INDEX = 0; + private static String [] DEV_NAMES = { + "jpackage.openjdk.java.net", + "jpackage.openjdk.java.net (รถ)", + }; + private static String DEFAULT_KEYCHAIN = "jpackagerTest.keychain"; + + public static String getDevName(int certIndex) { + // Always use values from system properties if set + String value = System.getProperty("jpackage.mac.signing.key.user.name"); + if (value != null) { + return value; + } + + return DEV_NAMES[certIndex]; + } + + public static int getDevNameIndex(String devName) { + return Arrays.binarySearch(DEV_NAMES, devName); + } + + // Returns 'true' if dev name from DEV_NAMES + public static boolean isDevNameDefault() { String value = System.getProperty("jpackage.mac.signing.key.user.name"); - DEV_NAME = (value == null) ? "jpackage.openjdk.java.net" : value; - APP_CERT = "Developer ID Application: " + DEV_NAME; - INSTALLER_CERT = "Developer ID Installer: " + DEV_NAME; - value = System.getProperty("jpackage.mac.signing.keychain"); - KEYCHAIN = (value == null) ? "jpackagerTest.keychain" : value; + if (value != null) { + return false; + } + + return true; + } + + public static String getAppCert(int certIndex) { + return "Developer ID Application: " + getDevName(certIndex); + } + + public static String getInstallerCert(int certIndex) { + return "Developer ID Installer: " + getDevName(certIndex); + } + + public static String getKeyChain() { + // Always use values from system properties if set + String value = System.getProperty("jpackage.mac.signing.keychain"); + if (value != null) { + return value; + } + + return DEFAULT_KEYCHAIN; } // Note: It is not clear if we can combine "--verify" and "--display", so @@ -63,13 +100,13 @@ private static List codesignResult(Path target, CodesignCheckType type) int exitCode = 0; Executor executor = new Executor().setExecutable("/usr/bin/codesign"); switch (type) { - case CodesignCheckType.VERIFY_UNSIGNED: + case VERIFY_UNSIGNED: exitCode = 1; - case CodesignCheckType.VERIFY: + case VERIFY: executor.addArguments("--verify", "--deep", "--strict", "--verbose=2", target.toString()); break; - case CodesignCheckType.DISPLAY: + case DISPLAY: executor.addArguments("--display", "--verbose=4", target.toString()); break; default: @@ -80,23 +117,23 @@ private static List codesignResult(Path target, CodesignCheckType type) } private static void verifyCodesignResult(List result, Path target, - boolean signed, CodesignCheckType type) { + boolean signed, CodesignCheckType type, int certIndex) { result.stream().forEachOrdered(TKit::trace); String lookupString; switch (type) { - case CodesignCheckType.VERIFY: + case VERIFY: lookupString = target.toString() + ": valid on disk"; checkString(result, lookupString); lookupString = target.toString() + ": satisfies its Designated Requirement"; checkString(result, lookupString); break; - case CodesignCheckType.VERIFY_UNSIGNED: + case VERIFY_UNSIGNED: lookupString = target.toString() + ": code object is not signed at all"; checkString(result, lookupString); break; - case CodesignCheckType.DISPLAY: + case DISPLAY: if (signed) { - lookupString = "Authority=" + APP_CERT; + lookupString = "Authority=" + getAppCert(certIndex); } else { lookupString = "Signature=adhoc"; } @@ -124,7 +161,7 @@ private static Result spctlResult(Path target, String type) { } private static void verifySpctlResult(List output, Path target, - String type, int exitCode) { + String type, int exitCode, int certIndex) { output.stream().forEachOrdered(TKit::trace); String lookupString; @@ -138,9 +175,9 @@ private static void verifySpctlResult(List output, Path target, } if (type.equals("install")) { - lookupString = "origin=" + INSTALLER_CERT; + lookupString = "origin=" + getInstallerCert(certIndex); } else { - lookupString = "origin=" + APP_CERT; + lookupString = "origin=" + getAppCert(certIndex); } checkString(output, lookupString); } @@ -155,20 +192,20 @@ private static List pkgutilResult(Path target) { return result; } - private static void verifyPkgutilResult(List result) { + private static void verifyPkgutilResult(List result, int certIndex) { result.stream().forEachOrdered(TKit::trace); String lookupString = "Status: signed by"; checkString(result, lookupString); - lookupString = "1. " + INSTALLER_CERT; + lookupString = "1. " + getInstallerCert(certIndex); checkString(result, lookupString); } - public static void verifyCodesign(Path target, boolean signed) { + public static void verifyCodesign(Path target, boolean signed, int certIndex) { List result = codesignResult(target, CodesignCheckType.VERIFY); - verifyCodesignResult(result, target, signed, CodesignCheckType.VERIFY); + verifyCodesignResult(result, target, signed, CodesignCheckType.VERIFY, certIndex); result = codesignResult(target, CodesignCheckType.DISPLAY); - verifyCodesignResult(result, target, signed, CodesignCheckType.DISPLAY); + verifyCodesignResult(result, target, signed, CodesignCheckType.DISPLAY, certIndex); } // Since we no longer have unsigned app image, but we need to check @@ -181,36 +218,36 @@ public static void verifyDMG(Path target) { } List result = codesignResult(target, CodesignCheckType.VERIFY_UNSIGNED); - verifyCodesignResult(result, target, false, CodesignCheckType.VERIFY_UNSIGNED); + verifyCodesignResult(result, target, false, CodesignCheckType.VERIFY_UNSIGNED, -1); } - public static void verifySpctl(Path target, String type) { + public static void verifySpctl(Path target, String type, int certIndex) { Result result = spctlResult(target, type); List output = result.getOutput(); - verifySpctlResult(output, target, type, result.getExitCode()); + verifySpctlResult(output, target, type, result.getExitCode(), certIndex); } - public static void verifyPkgutil(Path target) { + public static void verifyPkgutil(Path target, int certIndex) { List result = pkgutilResult(target); - verifyPkgutilResult(result); + verifyPkgutilResult(result, certIndex); } public static void verifyAppImageSignature(JPackageCommand appImageCmd, boolean isSigned, String... launchers) throws Exception { Path launcherPath = appImageCmd.appLauncherPath(); - SigningBase.verifyCodesign(launcherPath, isSigned); + SigningBase.verifyCodesign(launcherPath, isSigned, SigningBase.DEFAULT_INDEX); final List launchersList = List.of(launchers); launchersList.forEach(launcher -> { Path testALPath = launcherPath.getParent().resolve(launcher); - SigningBase.verifyCodesign(testALPath, isSigned); + SigningBase.verifyCodesign(testALPath, isSigned, SigningBase.DEFAULT_INDEX); }); Path appImage = appImageCmd.outputBundle(); - SigningBase.verifyCodesign(appImage, isSigned); + SigningBase.verifyCodesign(appImage, isSigned, SigningBase.DEFAULT_INDEX); if (isSigned) { - SigningBase.verifySpctl(appImage, "exec"); + SigningBase.verifySpctl(appImage, "exec", 0); } } diff --git a/test/jdk/tools/jpackage/macosx/base/SigningCheck.java b/test/jdk/tools/jpackage/macosx/base/SigningCheck.java index 9647f439411..fc8a274caf8 100644 --- a/test/jdk/tools/jpackage/macosx/base/SigningCheck.java +++ b/test/jdk/tools/jpackage/macosx/base/SigningCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,41 +33,33 @@ public class SigningCheck { - public static void checkCertificates() { - List result = findCertificate(SigningBase.APP_CERT, SigningBase.KEYCHAIN); - String key = findKey(SigningBase.APP_CERT, result); - validateCertificate(key); - validateCertificateTrust(SigningBase.APP_CERT); - - result = findCertificate(SigningBase.INSTALLER_CERT, SigningBase.KEYCHAIN); - key = findKey(SigningBase.INSTALLER_CERT, result); - validateCertificate(key); - validateCertificateTrust(SigningBase.INSTALLER_CERT); - } + public static void checkCertificates(int certIndex) { + if (!SigningBase.isDevNameDefault()) { + // Do not validate user supplied certificates. + // User supplied certs whose trust is set to "Use System Defaults" + // will not be listed as trusted by dump-trust-settings, so we + // cannot verify them completely. + return; + } - private static List findCertificate(String name, String keyChain) { - List result = new Executor() - .setExecutable("/usr/bin/security") - .addArguments("find-certificate", "-c", name, "-a", keyChain) - .executeAndGetOutput(); + // Index can be -1 for unsigned tests, but we still skipping test + // if machine is not configured for signing testing, so default it to + // SigningBase.DEFAULT_INDEX + if (certIndex <= -1) { + certIndex = SigningBase.DEFAULT_INDEX; + } - return result; - } + String key = MacCertificate.findCertificateKey(null, + SigningBase.getAppCert(certIndex), + SigningBase.getKeyChain()); + validateCertificate(key); + validateCertificateTrust(SigningBase.getAppCert(certIndex)); - private static String findKey(String name, List result) { - Pattern p = Pattern.compile("\"alis\"=\"([^\"]+)\""); - Matcher m = p.matcher(result.stream().collect(Collectors.joining())); - if (!m.find()) { - TKit.trace("Did not found a key for '" + name + "'"); - return null; - } - String matchedKey = m.group(1); - if (m.find()) { - TKit.trace("Found more than one key for '" + name + "'"); - return null; - } - TKit.trace("Using key '" + matchedKey); - return matchedKey; + key = MacCertificate.findCertificateKey(null, + SigningBase.getInstallerCert(certIndex), + SigningBase.getKeyChain()); + validateCertificate(key); + validateCertificateTrust(SigningBase.getInstallerCert(certIndex)); } private static void validateCertificate(String key) { @@ -85,20 +77,16 @@ private static void validateCertificate(String key) { private static void validateCertificateTrust(String name) { // Certificates using the default user name must be trusted by user. - // User supplied certs whose trust is set to "Use System Defaults" - // will not be listed as trusted by dump-trust-settings - if (SigningBase.DEV_NAME.equals("jpackage.openjdk.java.net")) { - List result = new Executor() - .setExecutable("/usr/bin/security") - .addArguments("dump-trust-settings") - .executeWithoutExitCodeCheckAndGetOutput(); - result.stream().forEachOrdered(TKit::trace); - TKit.assertTextStream(name) - .predicate((line, what) -> line.trim().endsWith(what)) - .orElseThrow(() -> TKit.throwSkippedException( - "Certifcate not trusted by current user: " + name)) - .apply(result.stream()); - } + List result = new Executor() + .setExecutable("/usr/bin/security") + .addArguments("dump-trust-settings") + .executeWithoutExitCodeCheckAndGetOutput(); + result.stream().forEachOrdered(TKit::trace); + TKit.assertTextStream(name) + .predicate((line, what) -> line.trim().endsWith(what)) + .orElseThrow(() -> TKit.throwSkippedException( + "Certifcate not trusted by current user: " + name)) + .apply(result.stream()); } } From 68815d54c199d39b14034c926777b492fa453a22 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Wed, 23 Aug 2023 20:41:28 +0000 Subject: [PATCH 161/162] 8314734: Remove unused field TypeVariableImpl.EMPTY_ANNOTATION_ARRAY Reviewed-by: bpb, darcy --- .../reflect/generics/reflectiveObjects/TypeVariableImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/java.base/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java b/src/java.base/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java index 6ed5281855c..7f2829eda20 100644 --- a/src/java.base/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java +++ b/src/java.base/share/classes/sun/reflect/generics/reflectiveObjects/TypeVariableImpl.java @@ -210,8 +210,6 @@ public AnnotatedType[] getAnnotatedBounds() { typeVarIndex()); } - private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0]; - // Helpers for annotation methods private int typeVarIndex() { TypeVariable[] tVars = getGenericDeclaration().getTypeParameters(); From 045ae6885ce33c7b718defabfc3f0736cc58e281 Mon Sep 17 00:00:00 2001 From: Kelvin Nilsen Date: Fri, 25 Aug 2023 18:25:49 +0000 Subject: [PATCH 162/162] 8314972: GenShen: promote_in_place needs to prepare remembered set before it enables old allocations within region Reviewed-by: ysr, wkemper --- .../gc/shenandoah/shenandoahHeapRegion.cpp | 64 ++++++++++--------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp index 8e22775e7f5..6194d3555b6 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp @@ -1015,6 +1015,40 @@ void ShenandoahHeapRegion::promote_in_place() { ShenandoahYoungGeneration* young_gen = heap->young_generation(); size_t region_size_bytes = ShenandoahHeapRegion::region_size_bytes(); + assert(get_top_before_promote() == tams, "Cannot promote regions in place if top has advanced beyond TAMS"); + + // Rebuild the remembered set information and mark the entire range as DIRTY. We do NOT scan the content of this + // range to determine which cards need to be DIRTY. That would force us to scan the region twice, once now, and + // once during the subsequent remembered set scan. Instead, we blindly (conservatively) mark everything as DIRTY + // now and then sort out the CLEAN pages during the next remembered set scan. + // + // Rebuilding the remembered set consists of clearing all object registrations (reset_object_range()) here, + // then registering every live object and every coalesced range of free objects in the loop that follows. + heap->card_scan()->reset_object_range(bottom(), end()); + heap->card_scan()->mark_range_as_dirty(bottom(), get_top_before_promote() - bottom()); + + // TODO: use an existing coalesce-and-fill function rather than replicating the code here. + HeapWord* obj_addr = bottom(); + while (obj_addr < tams) { + oop obj = cast_to_oop(obj_addr); + if (marking_context->is_marked(obj)) { + assert(obj->klass() != NULL, "klass should not be NULL"); + // This thread is responsible for registering all objects in this region. No need for lock. + heap->card_scan()->register_object_without_lock(obj_addr); + obj_addr += obj->size(); + } else { + HeapWord* next_marked_obj = marking_context->get_next_marked_addr(obj_addr, tams); + assert(next_marked_obj <= tams, "next marked object cannot exceed tams"); + size_t fill_size = next_marked_obj - obj_addr; + assert(fill_size >= ShenandoahHeap::min_fill_size(), "previously allocated objects known to be larger than min_size"); + ShenandoahHeap::fill_with_object(obj_addr, fill_size); + heap->card_scan()->register_object_without_lock(obj_addr); + obj_addr = next_marked_obj; + } + } + // We do not need to scan above TAMS because restored top equals tams + assert(obj_addr == tams, "Expect loop to terminate when obj_addr equals tams"); + { ShenandoahHeapLocker locker(heap->lock()); @@ -1051,36 +1085,6 @@ void ShenandoahHeapRegion::promote_in_place() { // add_old_collector_free_region() increases promoted_reserve() if available space exceeds PLAB::min_size() heap->free_set()->add_old_collector_free_region(this); } - - assert(top() == tams, "Cannot promote regions in place if top has advanced beyond TAMS"); - - // Since this region may have served previously as OLD, it may hold obsolete object range info. - heap->card_scan()->reset_object_range(bottom(), end()); - heap->card_scan()->mark_range_as_dirty(bottom(), top() - bottom()); - - // TODO: use an existing coalesce-and-fill function rather than - // replicating the code here. - HeapWord* obj_addr = bottom(); - while (obj_addr < tams) { - oop obj = cast_to_oop(obj_addr); - if (marking_context->is_marked(obj)) { - assert(obj->klass() != NULL, "klass should not be NULL"); - // This thread is responsible for registering all objects in this region. No need for lock. - heap->card_scan()->register_object_without_lock(obj_addr); - obj_addr += obj->size(); - } else { - HeapWord* next_marked_obj = marking_context->get_next_marked_addr(obj_addr, tams); - assert(next_marked_obj <= tams, "next marked object cannot exceed tams"); - size_t fill_size = next_marked_obj - obj_addr; - assert(fill_size >= ShenandoahHeap::min_fill_size(), "previously allocated objects known to be larger than min_size"); - ShenandoahHeap::fill_with_object(obj_addr, fill_size); - heap->card_scan()->register_object_without_lock(obj_addr); - obj_addr = next_marked_obj; - } - } - - // We do not need to scan above TAMS because top equals tams - assert(obj_addr == tams, "Expect loop to terminate when obj_addr equals tams"); } void ShenandoahHeapRegion::promote_humongous() {